def handle_stream(self, stream, address): conn = TcpConnection(self.io_loop, stream, address) self._connections[conn.name] = conn conn.set_connection_callback(self._connection_cb) conn.set_message_callback(self._message_cb) conn.set_write_complete_callback(self._write_complete_cb) conn.set_close_callback(self._remove_connection) conn.connect_established()