C socket get IP address from filedescriptor returned from accept

后端 未结 3 857
独厮守ぢ
独厮守ぢ 2021-01-02 07:26

I know this question seems typical and multiple times answered but I think if you read the details it is not so common (I did not find it).

The poin

3条回答
  •  渐次进展
    2021-01-02 08:16

    Statefull connection is uniquely identified by two end points Peer(address:port)<=>My(address:port). Both getpeername() and getsockname() are needed to get this information.

提交回复
热议问题