def _send_packet(self, data):
if self._closed:<EOL><INDENT>return<EOL><DEDENT>data = json.dumps(data)<EOL>def send():<EOL><INDENT>try:<EOL><INDENT>yield From(self.pipe_connection.write(data))<EOL><DEDENT>except BrokenPipeError:<EOL><INDENT>self.detach_and_close()<EOL><DEDENT><DEDENT>ensure_future(send())<EOL>
Send packet to client.