def stop(self): GObject.source_remove(self.watcher) if is_unix_socket(self.server_socket): unix_socket_path = self.server_socket.getsockname() else: unix_socket_path = None self.server_socket.shutdown(socket.SHUT_RDWR) self.server_socket.close() # clean up the socket file if unix_socket_path is not None: os.unlink(unix_socket_path)
def stop(self): GObject.source_remove(self.watcher) if is_unix_socket(self.server_socket): unix_socket_path = self.server_socket.getsockname() else: unix_socket_path = None self.server_socket.shutdown(socket.SHUT_RDWR) self.server_socket.close() # clean up the socket file if unix_socket_path is not None: os.unlink(unix_socket_path)
def disable_send(self): if self.send_id is None: return GObject.source_remove(self.send_id) self.send_id = None
def disable_recv(self): if self.recv_id is None: return GObject.source_remove(self.recv_id) self.recv_id = None
def disable_timeout(self): """Deactivate timeout mechanism.""" if self.timeout_id is None: return GObject.source_remove(self.timeout_id) self.timeout_id = None
def disable_send(self): if self.send_id is None: return GObject.source_remove(self.send_id) self.send_id = None
def disable_recv(self): if self.recv_id is None: return GObject.source_remove(self.recv_id) self.recv_id = None
def disable_timeout(self): """Deactivate timeout mechanism.""" if self.timeout_id is None: return GObject.source_remove(self.timeout_id) self.timeout_id = None