<s> from thrift . transport import TSocket <EOL> from thrift . transport import TTransport <EOL> from thrift . protocol import TBinaryProtocol <EOL> from thrift . server import TServer <EOL> import TestService <EOL> class TestServiceHandler : <EOL> def __init__ ( self ) : <EOL> pass <EOL> def ping ( self ) : <EOL> print "<STR_LIT>" <EOL> return "<STR_LIT>" <EOL> handler = TestServiceHandler ( ) <EOL> processor = TestService . Processor ( handler ) <EOL> transport = TSocket . TServerSocket ( port = <NUM_LIT> ) <EOL> tfactory = TTransport . TBufferedTransportFactory ( ) <EOL> pfactory = TBinaryProtocol . TBinaryProtocolFactory ( ) <EOL> server = TServer . TSimpleServer ( processor , transport , tfactory , pfactory ) <EOL> print ( '<STR_LIT>' ) <EOL> server . serve ( ) <EOL> print ( '<STR_LIT>' ) </s>
