コード例 #1
0
ファイル: network.py プロジェクト: mopidy/mopidy
    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)
コード例 #2
0
    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)
コード例 #3
0
ファイル: network.py プロジェクト: mopidy/mopidy
    def disable_send(self):
        if self.send_id is None:
            return

        GObject.source_remove(self.send_id)
        self.send_id = None
コード例 #4
0
ファイル: network.py プロジェクト: mopidy/mopidy
 def disable_recv(self):
     if self.recv_id is None:
         return
     GObject.source_remove(self.recv_id)
     self.recv_id = None
コード例 #5
0
ファイル: network.py プロジェクト: mopidy/mopidy
 def disable_timeout(self):
     """Deactivate timeout mechanism."""
     if self.timeout_id is None:
         return
     GObject.source_remove(self.timeout_id)
     self.timeout_id = None
コード例 #6
0
    def disable_send(self):
        if self.send_id is None:
            return

        GObject.source_remove(self.send_id)
        self.send_id = None
コード例 #7
0
 def disable_recv(self):
     if self.recv_id is None:
         return
     GObject.source_remove(self.recv_id)
     self.recv_id = None
コード例 #8
0
 def disable_timeout(self):
     """Deactivate timeout mechanism."""
     if self.timeout_id is None:
         return
     GObject.source_remove(self.timeout_id)
     self.timeout_id = None