[英]Remote connection not working. Couldn't connect to server with python socket
[WinError 10061] and [WinError 10060]. [WinError 10061] 和 [WinError 10060]。 These are the errors im getting when i send a client app to my friend.
这些是我向朋友发送客户端应用程序时遇到的错误。 Remotely it just doesn't work.
远程它只是不起作用。 Locally it works fine.
在本地它工作正常。 Can i get a full explanation step by step please cause i couldn't find any soulution and i'm getting mad.
我可以一步一步得到一个完整的解释吗,因为我找不到任何解决方案,我很生气。
SERVER:服务器:
import socket as s
HOST = 'ppp.ppp.p.ppp'
PORT = 33000
server_socket = s.socket(s.AF_INET, s.SOCK_STREAM)
server_socket.bind((HOST, PORT))
server_socket.listen()
while True:
client_socket, address = server_socket.accept()
print(f'Connected {address}')
CLIENT:客户:
import socket as s
HOST = 'ppp.ppp.p.ppp'
PORT = 33000
client_socket = s.socket(s.AF_INET, s.SOCK_STREAM)
client_socket.connect((HOST, PORT)) # here is error
PS: CLIENT GETS ERRORS NOT SERVER PS:客户端收到错误而不是服务器
welcome to SO.欢迎来到SO。 You and your friend are probably not on the same network.
您和您的朋友可能不在同一个网络上。 Therefore, when sending a connection request, your router (or your friends) does not know to relay the packet to the correct device in it's network.
因此,在发送连接请求时,您的路由器(或您的朋友)不知道将数据包中继到其网络中的正确设备。 There are multiple things you need to do:
您需要做很多事情:
Hopefully this resolves your issues.希望这可以解决您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.