def enable_send(self): if self.send_id is not None: return try: self.send_id = GObject.io_add_watch( self._sock.fileno(), GObject.IO_OUT | GObject.IO_ERR | GObject.IO_HUP, self.send_callback) except socket.error as e: self.stop('Problem with connection: %s' % e)
def register_server_socket(self, fileno): return GObject.io_add_watch( fileno, GObject.IO_IN, self.handle_connection)