MCPcopy Create free account
hub / github.com/PyQt5/PyQt / _handleNewConnection

Method _handleNewConnection

QWebChannel/Lib/WebChannelObject.py:120–129  ·  view source on GitHub ↗

新连接

(self)

Source from the content-addressed store, hash-verified

118 self.m_server.close()
119
120 def _handleNewConnection(self):
121 """新连接"""
122 socket = self.m_server.nextPendingConnection()
123 print('New WebSocket connection from {}'.format(
124 socket.peerAddress().toString()))
125 # 连接关闭信号
126 socket.disconnected.connect(self._handleDisconnected)
127 transport = WebSocketTransport(socket)
128 self.m_clients[socket] = transport
129 self.m_webchannel.connectTo(transport)
130
131 def _handleDisconnected(self):
132 """连接关闭"""

Callers

nothing calls this directly

Calls 1

WebSocketTransportClass · 0.85

Tested by

no test coverage detected