I'm relatively new to python and I'm trying to make a simple GUI chat with python. It is programmed to ask for a nickname when a client joins the server. All works fine until the part where I enter the nickname. When I enter the nickname I get these errors from the server and client respectively, I'll provide the tracebacks as well.
ConnectionResetError: [Errno 104] Connection reset by peer
(From server)
traceback:
Traceback (most recent call last):
File "server.py", line 51, in <module>
receive()
File "server.py", line 44, in receive
broadcast(f"{nickname} entered to the chat!
".encode('utf-8'))
File "server.py", line 17, in broadcast
client.send(message)
TypeError: can't set attributes of built-in/extension type 'set'
(from client)
traceback:
Traceback (most recent call last):
File "C:/Users/ISINDU WICKRAMASEKAR/PycharmProjects/guichat/client.py", line 94, in <module>
client = Client(HOST, PORT)
File "C:/Users/ISINDU WICKRAMASEKAR/PycharmProjects/guichat/client.py", line 22, in __init__
set.gui_done = False
The code for the server and client are also linked.
server -> https://pastebin.com/0W7Cw9Cu
client-> https://pastebin.com/FES2UNc1
What I have tried:
I tried googling for answers and I can't say I didn't get any, but I didn't understand how to implement those solutions for my issue. These are the links I referred to
Python handling socket.error: [Errno 104] Connection reset by peer
python can't set attributes of built-in/extension type 'object'
question from:
https://stackoverflow.com/questions/65941875/how-to-fix-typeerror-cant-set-attributes-of-built-in-extension-type-set 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…