Obtaining Own External IP Address in POSIX C

前端 未结 6 1668
长发绾君心
长发绾君心 2021-01-06 19:48

I\'m looking to obtain my own IP address in order to publish that information in to a Peer-to-Peer network. In POSIX/C we have getaddrinfo(NULL, ...), but this

6条回答
  •  执念已碎
    2021-01-06 20:35

    I'm not trying to make things more complicated though I should point out that a single computer can have several IP addresses. typically each network card will have one.

    a more specific way to ask would be "how do I find the IP address that will be used as the source address when I connect to foo.com.org" I like bortzmeyer's answer for this :)

提交回复
热议问题