def stop(self, timeout = <NUM_LIT>):
if (self._send_greenlet is not None) and(self._send_queue.qsize() > <NUM_LIT:0>):<EOL><INDENT>self.wait_send(timeout = timeout)<EOL><DEDENT>if self._send_greenlet is not None:<EOL><INDENT>gevent.kill(self._send_greenlet)<EOL>self._send_greenlet = None<EOL><DEDENT>if self._error_greenlet is not None:<EOL><INDENT>gevent.kill(self._error_greenlet)<EOL>self._error_greenlet = None<EOL><DEDENT>if self._feedback_greenlet is not None:<EOL><INDENT>gevent.kill(self._feedback_greenlet)<EOL>self._feedback_greenlet = None<EOL><DEDENT>return self._send_queue.qsize() < <NUM_LIT:1><EOL>
Send all pending messages, close connection.
Returns True if no message left to sent. False if dirty.

- timeout: seconds to wait for sending remaining messages. disconnect
  immedately if None.