Commits

William Pitcock committed 250e30a

rpc_client: implement actual calling mechanism

  • Participants
  • Parent commits 16d89ab

Comments (0)

Files changed (1)

 from the use of this software.
 """
 
+import socket
 import rpc_message
 
 class ServerProxy(object):
         self._allow_untrusted = allow_untrusted
 
     def _call(self, name, **kwargs):
+        sock = socket.create_connection((self._host, self._port))
         envelope = rpc_message.encode(self._secret, name, **kwargs)
-        response = rpc_message.encode(self._secret, None, hello=name)
+        sock.sendall(envelope)
+        response = sock.recv(4096)
+        socket.close()
 
         return rpc_message.decode(self._secret, response, self._allow_untrusted)[1]