Archived

This topic is now archived and is closed to further replies.

How to receive the ip

This topic is 5885 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, when i have a server program on a(any) computer and a client program on MY computer and I want to know the IP from the computer with the server on it,what different ways are possible ? (Please other ways than sending an E-Mail ). I am programming C++ and winsock. I hope the question isn''t to stupid. bye

Share this post


Link to post
Share on other sites
i assume you aren''t already connected (if you are, ask winsock and he''ll tell you)...
i also assume that you don''t want to hard-code the IP into the client...
the only way i can think of is to get a domain name and some webspace (so your client can look it up at "www.whatever.com", where it will always be available), and have the server FTP a short text file with it''s current IP whenever it changes (or goes online, or whatever). then, when the client wants to connect, have it download this file and extract the IP. also, when the server is shut down, it can FTP over the file, with a code or something, so the client gets that instead of the IP and can give the user a message to that effect.

--- krez (krezisback@aol.com)

Share this post


Link to post
Share on other sites
Hello,

thanks for your reply. The idea sounds good. Another idea i''ve
thought of is to send a message to my ICQ-adress. But how can
you realize that in winsock ? If nobody knows i will try your
idea with the webserver.

bye

Share this post


Link to post
Share on other sites
The web server is the best idea, because if you''re clever, you can make it so that the client program looks up the IP address itself (by downloading the page your server uploaded, and parsing the file). That''d be really cool!


codeka.com - Just click it.

Share this post


Link to post
Share on other sites