开发者

How long time will a data transfer channel been kept open when using UDP?

开发者 https://www.devze.com 2022-12-21 03:56 出处:网络
Image that PC1 and PC2 are trying to communicate via UDP. PC1 is behind a router and PC2 is not. PC1 sends out a开发者_StackOverflow中文版 UDP datagram to PC2.

Image that PC1 and PC2 are trying to communicate via UDP. PC1 is behind a router and PC2 is not.

PC1 sends out a开发者_StackOverflow中文版 UDP datagram to PC2.

PC2 can of course receive. Then PC2 sends back a UDP datagram to PC1.

We know PC1 can receive too, even if there is a router. The router will record the data channel (I do not want to use "connection" instead because it is UDP), and temporarily open the channel for PC1 from PC2, even if normally it will block if without port forwarding, etc.

So, my question is that how long time will the channel be kept open between PC1 and PC2 if PC1 opens it first?

Thanks


That depends entirely on the nature/type/configuration of the router/firewall between PC1 and PC2.

Protocols like STUN and ICE might allow you to figure out the value you seek. Certainly STUN will help you keep that NAT binding alive.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号