added a proper header and switched to use TBinaryProtocolAcceleratedFactory, added some debug print msgs
This commit is contained in:
parent
c945aba23f
commit
769f960401
7
server.py
Normal file → Executable file
7
server.py
Normal file → Executable file
@ -1,3 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from helloworld import HelloWorld
|
||||
from helloworld.ttypes import *
|
||||
from helloworld.constants import *
|
||||
@ -13,9 +16,11 @@ class HelloWorldHandler:
|
||||
self.log = {}
|
||||
|
||||
def ping(self):
|
||||
print 'Recieved Ping... returning pong'
|
||||
return "pong"
|
||||
|
||||
def sayHello(self, msg):
|
||||
print 'Recieved hello msg: %s' % msg
|
||||
if msg.lang in ('kp', 'kr'):
|
||||
hello = HELLO_IN_KOREAN
|
||||
elif msg.lang == 'fr':
|
||||
@ -30,7 +35,7 @@ handler = HelloWorldHandler()
|
||||
processor = HelloWorld.Processor(handler)
|
||||
transport = TSocket.TServerSocket('localhost', port=9090)
|
||||
tfactory = TTransport.TBufferedTransportFactory()
|
||||
pfactory = TBinaryProtocol.TBinaryProtocolFactory()
|
||||
pfactory = TBinaryProtocol.TBinaryProtocolAcceleratedFactory()
|
||||
|
||||
server = TServer.TSimpleServer(processor, transport, tfactory, pfactory)
|
||||
|
||||
|
Reference in New Issue
Block a user