Subversion Repositories SmartDukaan

Rev

Rev 777 | Blame | Compare with Previous | Last modification | View Log | RSS feed

from shop2020.thriftpy.test import TestService
from thrift.transport import TSocket, TTransport
from thrift.protocol.TBinaryProtocol import TBinaryProtocolFactory
from thrift.server import TServer
from shop2020.test.TestServiceHandler import TestServiceHandler



host_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_name
    server.serve()
    print "Server functioning"
    

if __name__ == '__main__':
    main()