Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

SDL_net get MAC address from socket

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 Vaclav   Members   

147
Like
0Likes
Like

Posted 14 May 2013 - 01:51 AM

Hi

Say I'm the server, a client is connected to me using TCP. How can I get the client's MAC address from it's socket using the SDL_net library?

Thank you for your help.



#2 Wooh   Members   

1088
Like
1Likes
Like

Posted 14 May 2013 - 04:26 AM

I don't think SDL_net has a way to get the MAC address. I guess you will have to get the client's MAC address using some platform specific way or some other library and send the MAC address in a TCP message to the server.

#3 Brother Bob   Moderators   

10276
Like
1Likes
Like

Posted 14 May 2013 - 04:28 AM

This has nothing to do with SDL, but the MAC address is only a link-level address and is never transported outside the link. The only MAC address you, as the server, will see is the last node the packace arrived from, likely your server's gateway or router. That is, incoming TCP-data is wrapped in an IP message that has your IP as the destination and the client's IP as the source, but it is wrapped in an ethernet frame with your MAC as the source and the last gateway or router's MAC address as the source.



#4 Vaclav   Members   

147
Like
0Likes
Like

Posted 14 May 2013 - 12:11 PM

Oh thank you, you're absolutely right!






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.