Oct-18-2018, 08:51 AM
I want to establish a connection between 2 diffrent mechies.
heres my code
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?
heres my code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
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 )) |
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?