Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.

Python

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!\n".encode('utf-8'))
  File "server.py", line 17, in broadcast
    client.send(message)


Python
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 -> Server - Pastebin.com[^]

client-> Client - Pastebin.com[^]

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

1. ubuntu - Python handling socket.error: [Errno 104] Connection reset by peer - Stack Overflow[^]

2.python can't set attributes of built-in/extension type 'object' - Stack Overflow[^]
Posted
Updated 28-Jan-21 6:33am

1 solution

As per the message:
line 22: set.gui_done = False

I think you probably mean:
Python
self.gui_done = False
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900