Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8037507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:56:58+00:00 2026-06-05T02:56:58+00:00

I am developing a gaming server using the Winsock2 API from Windows, just for

  • 0

I am developing a gaming server using the Winsock2 API from Windows, just for now until porting it to Linux.

The main problem I have found is that I don’t know how to differentiate gaming clients that come from the same router/network. Let´s imagine 2 gamers that are in the same network going to the Internet through the same router IP and port with, for example IP 220.100.100.100 and port 5000, how can my C/C++ server differentiate both TCP connections and know that they are two different gamers?

Can I find any difference in the sockaddr_in struct that returns the socket when accept(…) returns ??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:57:01+00:00Added an answer on June 5, 2026 at 2:57 am

    If the two clients (gamers) are behind a router, it is hard to differentiate them just using sockets.

    If you are using TCP then it shouldn’t be a problem. Each client connects over a unique socket so you know anything coming in on that socket is from them. When they first log on, I assume they supply some credentials (name, password) so just associate the credentials with the socket.

    If you are using a connectionless protocol, like UDP, the first time they contact you, you give them a unique number or token. Next time they contact you, they must include their token in the message, so that you can identify them.

    Am I missing something?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Developing an application using SWT to work in both Linux and Windows. I created
While developing a firefox extension, I create a wizard window from overlay.js using: this.wizard
I've been developing gaming site and planning to add an API to let developers
I am developing a multiplayer gaming server that uses Django for the webserver (HTML
im developing windows application using c#. i want to close the application and show
Developing a heavily XML-based Java-application, I recently encountered an interesting problem on Ubuntu Linux.
Currently developing an application using the newest version of symfony, obtained through PEAR. This
I´m developing a software in C# that uses static functions from a C++ .dll
Developing search utility to search a file entire computer system, works fine on windows
Developing a desktop application based on Java + Swing I faced the problem of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.