diff --git a/sjrpc/client/simple.py b/sjrpc/client/simple.py index 154903bc9bda57bc45f52e6bdbd13b5430cbe41d..5b4f3836e19b0738c3be6f98275afd9d39c27da1 100644 --- a/sjrpc/client/simple.py +++ b/sjrpc/client/simple.py @@ -21,6 +21,7 @@ class SimpleRpcClient(ConnectionManager): self._on_disconnect = on_disconnect self._connection = connection + self._connection.set_handler(default_handler) self.register(self._connection) @classmethod @@ -45,7 +46,8 @@ class SimpleRpcClient(ConnectionManager): connection = RpcConnection.from_addr(addr, port, None, enable_ssl=enable_ssl, cert=cert) - client = cls(connection, default_handler, on_disconnect) + client = cls(connection, default_handler=default_handler, + on_disconnect=on_disconnect) connection._manager = client return client