python - Python绑定公共IP以在没有相同网络的情况下连接
问题描述
我想绑定公共 ip 以连接没有相同网络的套接字。我该怎么做?
我试过了:
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Set the socket
server.bind(("public_ip", 12345))
我得到一个错误:
OSError: [WinError 10049] The requested address is not valid in its context
为什么它不工作?我是否在正确的路径上接收来自不在同一网络上的客户端的消息?
解决方案
推荐阅读
- jenkins - 如何在詹金斯工作区中签出 Artifactory 回购
- machine-learning - 我应该使用哪种机器学习算法来预测特定停车位是否会被占用?
- javascript - 在本机反应中使用 https 模块
- twitter-bootstrap - 如何使用 Bootstrap 创建自动网格布局
- prefect - 有没有办法在每个计划的流程运行时更新参数?
- logstash - Logstash - 更改克隆文档中字段的值(logstash-clone 过滤器插件)
- node.js - MS Bot 获取当前页面 url - Node.js
- pandas - Pandassql:加入两个表会改变列时间
- javascript - 如何使用 React 仅返回 JSON 数据的前 10 个结果
- c# - 如何从 IEnumerable 传递 int
自定义枚举验证器?