我们可以连接到不同网络上的套接字服务器吗?
对不起,我是这里建立网络的初学者。
我正在尝试连接到我朋友的网络。她距离我约10公里。我是客户端,她是我要连接并发送消息的服务器。
我试图在自己的LAN上连接两台计算机。它奏效了!当然,不同的IP。它不再起作用了!
我的问题是:
- 是否可以使用Python套接字模块连接到不同Internet提供商或网络上的一台或多台远程计算机?
- 是否可以使用Python套接字模块在WiFi LAN上的计算机和WiFi移动热点上的计算机上接收并发送消息?
- 我可能需要建立什么连接?
Excuse me, I am a beginner to networking here.
I am trying to connect to my friend's network. She is approximately 10 kilometers from me. I am the client and she is the server that I want to connect and send messages.
I tried to connect two computers on my own LAN. It worked!, but when I change internet of another laptop to mobile hotspot and try to connect to that laptop. Of course, different IP. It doesn't work anymore!
My questions are:
- Is it possible to connect to one or more remote computers that are on the different internet provider or network using python socket module?
- Is it possible to receive and send messages between a computer on WIFI LAN and a computer on WIFI mobile hotspot using python socket module?
- What do I probably need to make the connection?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的客户试图连接
跨越公共互联网
到rfc1918 私人地址
它将以您报告的方式失败。
您需要确保客户是
连接到可及服务器IP。
它必须是可路由的,
两者之间一定不能有防火墙
哪个过滤并丢弃您的数据包。
If your client is attempting to connect
across the public internet
to an rfc1918 private address,
it will fail in the way you reported.
You need to ensure the client is
connecting to a reachable server IP.
It must be routable,
and there must not be a firewall in between
which filters and discards your packets.