70
70
raise TypeError('args must be byte strings, not %r' % (args,))
71
71
if type(body) is not str:
72
72
raise TypeError('body must be byte string, not %r' % (body,))
73
request = self.get_smart_medium().get_request()
74
smart_protocol = protocol.SmartClientRequestProtocolOne(request)
75
smart_protocol.call_with_body_bytes((method, ) + args, body)
76
return smart_protocol.read_response_tuple()
74
medium_request = self.get_smart_medium().get_request()
76
# Send a request over the medium
77
request_encoder = protocol.ProtocolThreeRequester(medium_request)
78
request_encoder.call_with_body_bytes((method, ) + args, body)
81
response_handler = message.ConventionalResponseHandler()
82
response_proto = protocol._ProtocolThreeBase(response_handler)
83
response_handler.setProtoAndMedium(response_proto, medium_request)
84
response_tuple = response_handler.read_response_tuple()
86
# request = self.get_smart_medium().get_request()
87
# smart_protocol = protocol.SmartClientRequestProtocolOne(request)
88
# smart_protocol.call_with_body_bytes((method, ) + args, body)
89
# return smart_protocol.read_response_tuple()
78
91
def call_with_body_bytes_expecting_body(self, method, args, body):
79
92
"""Call a method on the remote server with body bytes."""