|
-
Sep 13th, 2008, 09:27 PM
#1
Thread Starter
Addicted Member
detecting server's ip address by the client
Is it possible to detect the ip address of the server you are connecting?
for example, using winsock, if the server created and started to listen at port "8080" and the ip address is for example "192.168.10.2"
if i'm the client, I can connect by setting the local port to 8080 by default, but the ip is not always the same, so for example the ip address of the server that i'm connecting to, is "192.168.10.2", so what if the i'm going to connect to ip address "192.168.10.3", is there anyway I can detect whose IP addresses created? even if we're not yet connected?
-
Sep 22nd, 2008, 10:53 AM
#2
Re: detecting server's ip address by the client
Not as far as I know, unless you want to make the server broadcast a message every now and then to all machines on the network... which is probably not a great idea.
-
Sep 22nd, 2008, 11:03 AM
#3
Re: detecting server's ip address by the client
When the client needs to know the IP address of the server, have it broadcast a "where are you?" UDP message to which the server would reply (without broadcasting!) with its IP.
Thats one solution.
-
Sep 22nd, 2008, 11:09 AM
#4
Re: detecting server's ip address by the client
Ah yeah I didnt think of doing it the other way around
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|