runtime icon indicating copy to clipboard operation
runtime copied to clipboard

TcpListener.AllowNatTraversal affects only current socket

Open alnikola opened this issue 6 years ago • 2 comments

TcpListener.AllowNatTraversal method sets IPProtectionLevel on socket to control socket listening scope and enable or disable Network Address Traversal. In the past, it just set the option directly on the socket instance in _serverSocket, and when TcpListener recreated a socket on Stop the new instance didn't inherit this option. It seems to be a mistake since there is no clear reason for not propagating this option.

Later, TcpListener was changed to dispose a socket instance on Stop and set _serverSocket to null which also caused the bug #32551 which is to be fixed by #32603. However, it was decided not to fix IPProtectionLevel propagation at that time to stay compatible with the old behavior. This is a follow-up issue to investigate the problem further and probably fix it.

alnikola avatar Feb 21 '20 13:02 alnikola

Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

This process is part of our issue cleanup automation.

This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.