Jump to content
  • Advertisement
Sign in to follow this  
Vaclav

SDL_net get MAC address from socket

This topic is 1980 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!