Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 3ef456ebc6
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (26 sloc) 0.779 kb
'''
The Proto! Python Async RPC based on Protobufers and TCP sokets.
Licenced under LPGLv2+.
Created on Oct 23, 2009
@author: Stanislav Yudin
'''
import logging
import proto
import sample_pb2
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger(__name__)
def async_callback(answer):
pass
if __name__ == '__main__':
print 'client starting'
#specifying generated classes
server = sample_pb2.sample_rpc_Stub(proto.ProtoChannel('localhost', 9999, sample_pb2))
controller = proto.ProtoController()
try:
rst = sample_pb2.sample_request()
rst.message = 'hello server!'
resp = server.the_method(controller, rst, async_callback)
print 'server answer %s' % str(resp.answer)
print 'client done'
except proto.ProtoError, pe:
print 'ProtoError:', str(pe)
Jump to Line
Something went wrong with that request. Please try again.