def __send_message(self, proto, payload):<EOL>
try:<EOL><INDENT>if not isinstance(payload, bytes):<EOL><INDENT>payload = payload.encode("<STR_LIT:utf-8>")<EOL><DEDENT>if not proto.connected:<EOL><INDENT>raise IOError("<STR_LIT>")<EOL><DEDENT>proto.sendMessage(payload)<EOL>logger.debug("<STR_LIT>", payload)<EOL><DEDENT>except Exception as ex:<EOL><INDENT>logger.exception("<STR_LIT>")<EOL>proto.reraise(ex)<EOL><DEDENT>
Sends a message