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?
Re: Get IP address on remote machine
Try gethostbyname or getaddrinfo
Re: Get IP address on remote machine
Quote:
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.
Re: Get IP address on remote machine