Rev 777 | Blame | Compare with Previous | Last modification | View Log | RSS feed
from shop2020.thriftpy.test import TestServicefrom thrift.transport import TSocket, TTransportfrom thrift.protocol.TBinaryProtocol import TBinaryProtocolFactoryfrom thrift.server import TServerfrom shop2020.test.TestServiceHandler import TestServiceHandlerhost_name = 'localhost'port = '9009'def main():host_name = 'localhost'port = '9009'handler = TestServiceHandler()processor = TestService.Processor(handler)transport = TSocket.TServerSocket(port)tfactory = TTransport.TFramedTransportFactory()pfactory = TBinaryProtocolFactory()server = TServer.TThreadedServer(processor, transport, tfactory, pfactory)print "Starting Test at, port "+ str(port)+" host "+host_nameserver.serve()print "Server functioning"if __name__ == '__main__':main()