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.
我对套接字编程很陌生。我试图使用 udp 进行 p2p 通信,并最终成功了。在编写程序时,我观察到的一点是,如果没有从双方发送数据包,两个对等方之间的通信就不会发生。我在某处读到,在网络中它被称为乒乓球。
我想知道为什么它是这样设计的?
您遇到的问题可能是由于防火墙和 NAT 路由器造成的。
解决方案是使用NAT 遍历技术(最有用的信息是另请参阅下列出的各种技术)。