Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Using MAC address

Using MAC address

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionlearning
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shay Harel
    wrote on last edited by
    #1

    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

    J 1 Reply Last reply
    0
    • S Shay Harel

      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

      J Offline
      J Offline
      Johnny
      wrote on last edited by
      #2

      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)

      S 1 Reply Last reply
      0
      • J Johnny

        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)

        S Offline
        S Offline
        Shay Harel
        wrote on last edited by
        #3

        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

        G 1 Reply Last reply
        0
        • S Shay Harel

          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

          G Offline
          G Offline
          geo_m
          wrote on last edited by
          #4

          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.

          S 1 Reply Last reply
          0
          • G geo_m

            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.

            S Offline
            S Offline
            Shay Harel
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups