I am writing a simple Client-Server connection. When I try it at home, where all devices are on the same network, it is all fine and the code works perfect. But when I try to use it on devices with different networks, this error occures:
[WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Client Code:
host = 'ip_example'
port = 3333
self.s = socket(AF_INET6, SOCK_STREAM)
print("Connecting")
self.s.connect((host, port))
Server Code:
host = ''
port = 3333
self.s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.s.bind((host, port))
self.s.listen(3)
self.connection, self.addr = self.s.accept()
Can someone help me? (BTW, I even tried to disable the firewall)