How long time will a data transfer channel been kept open when using UDP?
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.
精彩评论