Get IP address from socket descriptor?

后端 未结 4 1190
轻奢々
轻奢々 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条回答
  •  萌比男神i
    2021-01-19 04:02

    The address of the server is up to you.

    Depends on which parameters are passed to the bind() function.

    You can specify a single ip or bind your socket to every address of your host.

    Look at the Bind man page

提交回复
热议问题