How does peer2peer work through a router?

你说的曾经没有我的故事 提交于 2019-12-18 12:37:47

问题


How does one PC connect to another over the internet to another PC?

An example would be a program listening for connections on PC 1. PC 1 sits behind Router 1. PC 2 has a client program trying to connect to PC 1.

What is the correct technology/technique to use as the listening program in this situation?


回答1:


This article by Brian Ford explains how peer to peer communication across NATs work.

Most routers also expose a Universal Plug and Play interface (uPnP) which can be used for port forwarding and NAT traversal.

You should also check out the STUNT library which is an easy to use NAT traversal library.




回答2:


You may want to read up on NAT Traversal. NAT traversal is a general term for techniques that establish and maintain TCP/IP network connections traversing network address translation (NAT) gateways.



来源:https://stackoverflow.com/questions/575448/how-does-peer2peer-work-through-a-router

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!