Obtaining Own External IP Address in POSIX C

前端 未结 6 1662
长发绾君心
长发绾君心 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:41

    By public address, you're saying, an address that your application's peers can contact you with. The only full-proof way is to connect to a known "external" peer and have it send your address back to you.

提交回复
热议问题