Get IP address from socket descriptor?

后端 未结 4 1155
轻奢々
轻奢々 2021-01-19 03:06

I\'ve opened a TCP socket server (I\'ve omitted a few stuff, it is taken from here

sockfd = socket(p->ai_family, p->ai_socktype,
            p->ai_p         


        
4条回答
  •  生来不讨喜
    2021-01-19 03:53

    The address of the server is the one that was passed to the successfull call to bind() (as shown in the source you linked).

提交回复
热议问题