def recv(self, socket, mode=zmq.NOBLOCK, content=True, copy=True):
if isinstance(socket, ZMQStream):<EOL><INDENT>socket = socket.socket<EOL><DEDENT>try:<EOL><INDENT>msg_list = socket.recv_multipart(mode, copy=copy)<EOL><DEDENT>except zmq.ZMQError as e:<EOL><INDENT>if e.errno == zmq.EAGAIN:<EOL><INDENT>return None,None<EOL><DEDENT>else:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>idents, msg_list = self.feed_identities(msg_list, copy)<EOL>try:<EOL><INDENT>return idents, self.unserialize(msg_list, content=content, copy=copy)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise e<EOL><DEDENT>
Receive and unpack a message.

        Parameters
        ----------
        socket : ZMQStream or Socket
            The socket or stream to use in receiving.

        Returns
        -------
        [idents], msg
            [idents] is a list of idents and msg is a nested message dict of
            same format as self.msg returns.