You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
654 B

7 years ago
import sys
from thrift.protocol import TBinaryProtocol
from thrift.transport import TSocket, TTransport
7 years ago
sys.path.append('/root/PixivSearch')
7 years ago
from PixivSearch.thrift.TestQry.TestQry import Client
if __name__ == '__main__':
# Make socket
7 years ago
socket = TSocket.TSocket('mikuhime.xyz', 2233)
7 years ago
# Buffering is critical. Raw sockets are very slow
transport = TTransport.TFramedTransport(socket)
if not transport.isOpen():
transport.open()
# Wrap in a protocol
protocol = TBinaryProtocol.TBinaryProtocol(transport)
# Create a client to use the protocol encoder
client = Client(protocol)
7 years ago
print(client.qryTest(1))