新连接
(self)
| 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 | """连接关闭""" |
nothing calls this directly
no test coverage detected