def write(self, message):
try:<EOL><INDENT>self.socket.send(message.encode('<STR_LIT:utf-8>') + b'<STR_LIT>')<EOL><DEDENT>except socket.error:<EOL><INDENT>if not self._closed:<EOL><INDENT>raise BrokenPipeError<EOL><DEDENT><DEDENT>return Future.succeed(None)<EOL>
Coroutine that writes the next packet.