Using MAC address
-
Hi, I am using CSocket class to connect between two PC and everything works fine. However, when the other PC is power cycled, it's IP address is changing and then I'm lost of course. Is there any way to use the MAC address of the other PC in any class that MFC offers ? Thanks, Shay
-
Hi, I am using CSocket class to connect between two PC and everything works fine. However, when the other PC is power cycled, it's IP address is changing and then I'm lost of course. Is there any way to use the MAC address of the other PC in any class that MFC offers ? Thanks, Shay
-
The short answer is no - MFC needs the IP address. However, this problem is not new, and there are many pieces of software and services that might be able to help (take a look at DynIP for a starter)
Thanks for the reply but this may be a bit risky to the end user. So... Are all the file swap services and chats like messenger etc. work only via a central server that facilitate the connection ? Shay
-
Thanks for the reply but this may be a bit risky to the end user. So... Are all the file swap services and chats like messenger etc. work only via a central server that facilitate the connection ? Shay
Yes, they generally all uses some sort of central server. Problem is that you can't use MAC outside your LAN network segment. Outside of this scope even the MAC address is different (see ARP for details). For connecting over tcp/ip or udp/ip you always need a IP address. You can consider using udp broadcasts in your design - newly started application can send udp broadcast (I'm here and my address is ...) to all interesting parties. But usage of broadcasts are usually limited by the network architecture - usually up to the nearest router.
-
Yes, they generally all uses some sort of central server. Problem is that you can't use MAC outside your LAN network segment. Outside of this scope even the MAC address is different (see ARP for details). For connecting over tcp/ip or udp/ip you always need a IP address. You can consider using udp broadcasts in your design - newly started application can send udp broadcast (I'm here and my address is ...) to all interesting parties. But usage of broadcasts are usually limited by the network architecture - usually up to the nearest router.
The UDP broadcat is a nice concept, but I am connecting to PCs overseas so as you said, it will not go beyond the router. thanks for the info.