4
我試圖使用線程socket服務器Python的SocketServer的問題
self.server = SocketServer.ThreadingTCPServer((HOST, PORT), MCRequestHandler)
和析構函數
def __del__(self):
self.server.shutdown();
self.server.server_close()
print('Server closed ! ');
當我關閉GUI的德爾函數將被調用,但是如果我想重新開始程序,我收到以下錯誤消息
socket.error: [Errno 98] Address already in use
Exception AttributeError: "'MCCommunication' object has no attribute 'server'" in <bound method MCCommunication.__del__ of <MCCommunication.MCCommunication object at 0x26867c0>> ignored