def writter_run(self):
with self.write_cond:<EOL><INDENT>while self.sock is not None:<EOL><INDENT>while self.ready and self.wdata and self.write_enabled:<EOL><INDENT>sent = self.sock.send(self.wdata)<EOL>logger.debug("<STR_LIT>" + repr(self.wdata[:sent]))<EOL>self.wdata = self.wdata[sent:]<EOL>self.write_cond.notify()<EOL><DEDENT>if self._disconnect and not self.wdata:<EOL><INDENT>self.sock.shutdown(socket.SHUT_WR)<EOL>logger.debug("<STR_LIT>")<EOL>break<EOL><DEDENT>self.write_cond.wait()<EOL><DEDENT><DEDENT>
The writter thread function.