|
-
March 5th, 2009, 05:01 PM
#1
Get IP address on remote machine
I have two small programs (server and client) that establish communication between two PCs connected with an ethernet cable. I was able to do so using Win sockets and static IPs on both machines.
Lately I had to enable the Internet connection sharing between the two, which made me change the TCP/IP connection properties to "Obtain an IP address automatically". Now I'm faced with a dilemma of IP constantly changing and thus my two programs not being able to communicate anymore.
I'm not really good at network programming. Can someone suggest what shall I do to obtain the IP address of a remote computer connected this way?
-
March 8th, 2009, 11:51 PM
#2
Re: Get IP address on remote machine
Try gethostbyname or getaddrinfo
-
March 9th, 2009, 06:54 PM
#3
Re: Get IP address on remote machine
 Originally Posted by _Superman_
Try gethostbyname or getaddrinfo
This will give an IP of the machine those commands were run on, right? And I need the IP of machine connected via Ethernet cable through a network adapter.
-
March 9th, 2009, 06:55 PM
#4
Re: Get IP address on remote machine
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
|