Closed georgeto closed 10 months 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
tcp:getsockname()
udp:getsockname()
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
getsockname()
The documentation of
tcp:getsockname()
andudp: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-L136However, 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