Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I use getaddrinfo to get the ip address of the server, it works well on other 3 machines, but always get local address 127.0.0.1 on an 64 bit linux machine. Therefore, other remote clients can not connect to the socket server because the server binds local address l27.0.0.1.
I have also tried pass 0.0.0.0 to getaddrinfo, now the server bind on 0.0.0.0(all available interface). But now I can not print the correct network address of the server, as it is always 0.0.0.0 which is provided by getsockname.
I do not know how to get the network address of the server, rather than the local address. Can anyone help me out? Thanks a lot.
This probably would get better attention and the right kind of attention in the programming forums.
Without having a look at the relevant pieces of code to determine what might be going wrong, it's really hard to say what the specific problem is or maybe.
Yes, but I want to get the address by c program. Thanks.
To be honest I'd suggest posting how you're currently getting the ip address, hard to guess what you may or may not be doing correctly without seeing the code itself. Because it works on one particular subset of machines does not mean its portable or correct.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.