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
{{ message }}
Repository navigation
Mac: IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners() does not list NodeJs listener #27585
GetActiveTcpListeners() seems totally broken @karelz. On OSX it gives me TCP connections but no actual listeners. e.g. socket in LISTEN state. I did run on Linux for comparison and there it does list listening sockets but it also includes other sockets.
It seems like GetActiveTcpConnections() is also not working right on LInux.
According to documentation:
The objects returned by this method include connections in all TCP states except the Listen state. You can check the state of a connection by calling State.
Problem with OSX is that kernel provides port numbers in network byte order but PAL does not convert them to host order. To workaround this you can call GetActiveTcpConnections() and look for State==Listen and port == 36895 (8080 -> 0x1f90 -> 0x901f -> 36895)
Activity
karelz commentedon Oct 11, 2018
@IlyaBiryukov can you please try it with ASP.NET Core local server as well? Is it specific to NodeJs server only?
Would you be able to tell if the Mac OS APIs truly return correct info? We basically just return what the OS tells us:
https://github.com/dotnet/corefx/blob/a10890f4ffe0fadf090c922578ba0e606ebdd16c/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/OsxIPGlobalProperties.cs#L10-L23
wfurt commentedon Oct 12, 2018
GetActiveTcpListeners() seems totally broken @karelz. On OSX it gives me TCP connections but no actual listeners. e.g. socket in LISTEN state. I did run on Linux for comparison and there it does list listening sockets but it also includes other sockets.
karelz commentedon Oct 12, 2018
@wfurt is it broken on our side, or is the OS API giving us useless information?
wfurt commentedon Oct 12, 2018
I don't know yet. I did not find any tests for this function. I'll do basic triage for both OSX and Linux since I have repro code running.
wfurt commentedon Oct 14, 2018
It seems like GetActiveTcpConnections() is also not working right on LInux.
According to documentation:
gives
and the listener list returns:
wfurt commentedon Oct 15, 2018
Problem with OSX is that kernel provides port numbers in network byte order but PAL does not convert them to host order. To workaround this you can call GetActiveTcpConnections() and look for State==Listen and port == 36895 (8080 -> 0x1f90 -> 0x901f -> 36895)