I have a tcp connected socket handle, created through an accept. Only the handle, not other structs. How can I retrieve its REMOTE port from the handle? I mean, the tcp source port of the connection Remote Client ---> Me
2
votes
1 Answers
8
votes
The getpeername function gets information about the remote side, including the port number; getsockname does the same for the local side of the connection.