def receive(self,message_type):
topic = None<EOL>message = None<EOL>if message_type == RAW:<EOL><INDENT>message = self._sock.recv(flags=zmq.NOBLOCK)<EOL><DEDENT>elif message_type == PYOBJ:<EOL><INDENT>message = self._sock.recv_pyobj(flags=zmq.NOBLOCK)<EOL><DEDENT>elif message_type == JSON:<EOL><INDENT>message = self._sock.recv_json(flags=zmq.NOBLOCK)<EOL><DEDENT>elif message_type == MULTIPART:<EOL><INDENT>data = self._sock.recv_multipart(flags=zmq.NOBLOCK)<EOL>message = data[<NUM_LIT:1>]<EOL>topic = data[<NUM_LIT:0>]<EOL><DEDENT>elif message_type == STRING:<EOL><INDENT>message = self._sock.recv_string(flags=zmq.NOBLOCK)<EOL><DEDENT>elif message_type == UNICODE:<EOL><INDENT>message = self._sock.recv_unicode(flags=zmq.NOBLOCK)<EOL><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>"%(self._message_type,))<EOL><DEDENT>return (topic, message)<EOL>
Receive the message of the specified type and retun

    Args:
        - message_type: the type of the message to receive

    Returns:
        - the topic of the message
        - the message received from the socket