lunarmodules / luasocket

Network support for the Lua language
http://lunarmodules.github.io/luasocket/
MIT License
1.83k stars 626 forks source link

tcp/udp:getsockname() returns port as string not as number as stated in docs #391

Closed georgeto closed 10 months ago

georgeto commented 2 years ago

The documentation of tcp:getsockname() and udp:getsockname() states that the port is returned as number: https://github.com/lunarmodules/luasocket/blob/26b524e1d7b9a00045882d3c0f25486485b1d6a8/docs/tcp.html#L285-L286 https://github.com/lunarmodules/luasocket/blob/26b524e1d7b9a00045882d3c0f25486485b1d6a8/docs/udp.html#L135-L136

However, in reality the getsockname() implementation used by both returns the port as a string: https://github.com/lunarmodules/luasocket/blob/26b524e1d7b9a00045882d3c0f25486485b1d6a8/src/inet.c#L293