No connection could be made becouse the target machine actively refused it. - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Networking (https://python-forum.io/forum-12.html) +--- Thread: No connection could be made becouse the target machine actively refused it. (/thread-13501.html) |
No connection could be made becouse the target machine actively refused it. - GottaAimHigherPal - Oct-18-2018 I want to establish a connection between 2 diffrent mechies. heres my code server: #!/usr/bin/python # This is server.py file import socket # Import socket module s = socket.socket() # Create a socket object host = socket.gethostname() # Get local machine name port = 14321 # Reserve a port for your service. s.bind((host, port)) # Bind to the port s.listen(5) while True: c, addr = s.accept() # Establish connection with client. print ("Got connection from", addr) msg = input("what do you want to send?\n") c.send(msg) client: #!/usr/bin/python # This is client.py file import socket # Import socket module s = socket.socket() # Create a socket object host = socket.gethostname() # Get local machine name port = 14321 # Reserve a port for your service. while True: s.connect((host, port)) print (s.recv(1024))HEEEELP it says No connection could be made becouse the target machine actively refused it. what? iv tryed a vpn btw... and it still desent work? help? RE: No connection could be made becouse the target machine actively refused it. - Larz60+ - Oct-18-2018 It may be looking for user agent, but there are many reasons why connection may be refused. At any rate you can explore the guide here: https://www.w3.org/Protocols/rfc2616/rfc2616.html |