You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This appears to be a regression in 5.0 caused by dotnet/corefx#41547. In previous versions, _serverSocket would still be valid after calling .Stop().
Note that AllowNatTraversal can only be called on a stopped listener, so with this bug it means you can only call AllowNatTraversal immediately after creating the listener and before calling Start.
If AllowNatTraversal is called on a stopped TcpListener when ```_serverSocket``` is null, ```allow``` value gets stored in a field. Subsequently, if a new socket is created on Start call, the saved value is read and the corresponding argument is passed to SetIPProtectionLevel call after which the value is reset to preserve the current IPProtectionLevel propagation logic. The follow-up issue is #32653Fixes#32551
ghost
locked as resolved and limited conversation to collaborators
Dec 10, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Execute the following code on .NET 5:
It will throw a NRE on line 121:
runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/TCPListener.cs
Lines 114 to 121 in e41651e
This appears to be a regression in 5.0 caused by dotnet/corefx#41547. In previous versions,
_serverSocket
would still be valid after calling.Stop()
.Note that
AllowNatTraversal
can only be called on a stopped listener, so with this bug it means you can only callAllowNatTraversal
immediately after creating the listener and before callingStart
./cc @alnikola
The text was updated successfully, but these errors were encountered: