<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def send_message(self, message, sign=True):
 		"""Send the given message to the connection. 		@type message: OmapiMessage 		@param sign: whether the message needs to be signed 		@raises OmapiError: 		@raises socket.error: 		"""

		if sign:
			message.sign(self.authenticators[self.defauth])
		logger.debug("sending %s", LazyStr(message.dump_oneline))
		self.transport.write(message.as_string())