|
|
|
@ -1,8 +1,5 @@ |
|
|
|
|
from thrift.protocol import TBinaryProtocol |
|
|
|
|
from thrift.protocol.TBinaryProtocol import TBinaryProtocolFactory |
|
|
|
|
from thrift.server.TNonblockingServer import TNonblockingServer |
|
|
|
|
from thrift.transport import TSocket |
|
|
|
|
from thrift.transport.TTransport import TFramedTransport |
|
|
|
|
|
|
|
|
|
from PixivSearch.thrift.TestQry import TestQry |
|
|
|
|
from PixivSearch.thrift.TestQry.ttypes import QryResult |
|
|
|
@ -22,8 +19,8 @@ class QueryImpl(TestQry.Iface): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
|
socket = TSocket.TSocket(port=2233) |
|
|
|
|
socket = TSocket.TServerSocket(port=2233) |
|
|
|
|
processor = TestQry.Processor(QueryImpl()) |
|
|
|
|
server = TNonblockingServer(processor, socket, TBinaryProtocolFactory(), TFramedTransport()) |
|
|
|
|
server = TNonblockingServer(processor, socket) |
|
|
|
|
|
|
|
|
|
server.serve() |
|
|
|
|