socConnection[0] = socket( AF_INET, SOCK_STREAM, 0);
adrServer[0].sin_family = AF_INET;
adrServer[0].sin_port = htons (5555);
adrServer[0].sin_addr.s_addr = htonl (INADDR_ANY);
Or am I on the wrong track?
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Getting a IP from a Socket
Ok here''s how I setup my sockaddr_in. I was just wondering how to get what IP it picks for INADDR_ANY.
getsockname should do the trick.
However it may not work until the socket has been connected and/or you''ve done at least one I/O.
-Mike
However it may not work until the socket has been connected and/or you''ve done at least one I/O.
-Mike
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement