diff --git a/sjrpc/core/rpcconnection.py b/sjrpc/core/rpcconnection.py index de22c4bb8b55dbef8eaa91583d56635e515bf6a3..2b42164144fbb260e85a7a0188ff4931a978176d 100644 --- a/sjrpc/core/rpcconnection.py +++ b/sjrpc/core/rpcconnection.py @@ -12,6 +12,7 @@ import socket import logging from sjrpc.core.protocols.rpc import RpcProtocol +from sjrpc.core.protocols import Protocol from sjrpc.core.exceptions import RpcError import pyev @@ -196,6 +197,12 @@ class RpcConnection(object): # Get the registered protocol for the specified label self._proto_receiving = self._protocols.get(label) + + # If frame's label is not binded to a protocol, we create a + # dummy protocol to consume the payload: + if self._proto_receiving is None: + self._proto_receiving = Protocol(self, -1) + self._proto_receiving.start_message(pl_size) self._inbound_buffer = '' self._remains = pl_size