def _read_message(self):
        """ Reads a message from the socket and converts it to a message. """
        # first 4 bytes is Big-Endian payload length
        payload_info = self._read_bytes_from_socket(4)
        read_len = unpack(">I", payload_info)[0]

        # now read the payload
        payload = self._read_bytes_from_socket(read_len)

        # pylint: disable=no-member
        message = cast_channel_pb2.CastMessage()
        message.ParseFromString(payload)

        return message
def _read_message ( self ) : payload_info = self . _read_bytes_from_socket ( 4 ) read_len = unpack ( ">I" , payload_info ) [ 0 ] payload = self . _read_bytes_from_socket ( read_len ) message = cast_channel_pb2 . CastMessage ( ) message . ParseFromString ( payload ) return message
Reads a message from the socket and converts it to a message.