Question: I'm working on a chat server/chatclient assignment. This is written in Python. I am getting ConnectionRefusedError: [Errno 61] Connection refused $ python3 ChatClient.py 8080 Traceback

I'm working on a chat server/chatclient assignment. This is written in Python. I am getting ConnectionRefusedError: [Errno 61] Connection refused $ python3 ChatClient.py 8080 Traceback (most recent call last): File "ChatClient.py", line 39, in sock.connect((server, int(sys.argv[1]))) socket.gaierror: [Errno 8] nodename nor servname provided, or not known

I have tried using 'localhost', '127.01.etc', and Local Lan call as socket.connect inputs. I am not sure how to fix. Thanks in advance.

I'm working on a chat server/chatclient assignment. This is written in Python.

ChatClient.py receive def usage( script_name ): print( 'Usage: py' script_name) def receive): try: msg_bytes sock.recv ( 1024) = except msg_bytesFalse while msg_bytes: answer msg_bytes.decode() print(answer, end) try: msg_bytessock.recv(1024) except break sock.close() os._exit() def send): msg-bytes = "hello" while msg_bytes: msg bytessys.stdin.readline() sock.send (msg_bytes).encode () if __name"main": import sys import socket import threading import os argc- len (sys.argv) if argc

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!