Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两台服务器需要能够相互发送请求,并且我需要它们能够通过 NAT 或路由器进行通信。一台服务器有一个注册的域,它总是在等待连接。另一台服务器在启动时向第一台服务器发送第一个请求(登录请求)。让两台服务器继续通信的最佳方式是什么?
嗯?这应该不是问题。如果第一台服务器,即具有注册名称的服务器,则始终与另一台服务器联系。
只要第二台机器具有一般的 Internet 连接,它所要做的就是打开一个到 firstserver.example.com 或其他任何东西的 TCP/IP 连接,它们应该能够通过该连接无限期地继续通信。
这与使用 NAT 的一般冲浪没有什么不同。