LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read MAC address of TCP client in Tcp server

Hello,

I am working on a project in which information is exchanged between server and client. we are using two different laptops , 1 as a server and another as a client. But as the project involves multiple clients we want to distinguish the clients on the basis of MAc address. Please tell me a way to read mac address of tcp client in tcp server so that server get to know the client and sends information accordingly.


Thanks

0 Kudos
Message 1 of 2
(3,192 Views)

Are both computers on the same local network - no router between them? If not, then there's no way to query the MAC address as far as I know; the client would have to send that identification information. However, that might not be a bad approach - is there any reason you can't have the client send a unique identifier, such as MAC address, when it first connects to the server?

 

If the computers are on the same local network, then you can use System Exec to run the arp command. On Windows, the command line would be "arp -a [ip address of remote system]". You'll then need to parse the returned text to get the MAC address. Try it out at a Windows command prompt to see the format of the response. This only works if the computers have already established a connection; if not, then the MAC address isn't cached in the ARP table and you'll have to ping the IP address first.

Message 2 of 2
(3,171 Views)