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 6851083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:12:17+00:00 2026-05-27T01:12:17+00:00

I cant seem to figure out how to do the next step for my

  • 0

I cant seem to figure out how to do the next step for my UDP server. So far one client connects and then it sends data back and forth but when another client connects the server will take data from the new client and send it to the other.

I was going to check if the message that has been received is from a new client or not, if it is then give that client an identifier that the server uses to do some processing. Is that the correct way to do it? If so how do you do it? I know that recvfrom has “sockaddr *from” field which I assume fills that field with the data of the client but how do I use that data?

Thanks

  • 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-05-27T01:12:18+00:00Added an answer on May 27, 2026 at 1:12 am
    sockaddr_in saddr;
    int length = sizeof(saddr);
    int read = recvfrom(your_socket, buff, 4096, 0, (sockaddr*)&saddr, &length);
    if(read != -1) {
       // now saddr contains the address of the client
       // the g_addr is a previously captured client address
       if(saddr.sin_addr.S_un.S_addr = g_addr.sin_addr.S_un.S_addr) {
          // returning client?
       } else {
          // not yet seen client, so store address
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey guys having this really simple problem but cant seem to figure out have
I can't seem to figure out why SQL Server is taking a completely different
i cant seem to figure out the logic, here's my code class stringrays {
I cant seem to figure out how to create a simple NSOutlineView with 2
I have found this script and cant seem to figure out why it throws
I can't seem to figure out how to get dependency injection to work in
I can't seem to figure out how to get the offsetTop of an element
I can't seem to figure out how to correctly select a Multi Select option
I can't seem to figure out how to inject a disabled element. Any help
I can't seem to figure out what's wrong with my function.... I need to

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.