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

  • Home
  • SEARCH
  • 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 3975798
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:43:41+00:00 2026-05-20T04:43:41+00:00

I am designing a UDP protocol which only requires there to be a single

  • 0

I am designing a UDP protocol which only requires there to be a single client and a single server, however I would like the ability to support multiple clients, or even better, multiple clients on the same machine.

When a client connects to the server, the server receives the client’s IP and outgoing UDP port along with the message. However, I have not had any success in responding to the client via that outgoing port.

I guess my question is about what the right way of implementing something like this is, if data is to be sent both ways (client to server, and server back to client). It appears to me now that a single socket will not be sufficient, and that both the client and the server must maintain both a “listening” socket, and a separate “sending” socket. The sending socket must also be repeatedly opened and closed if the recipient changes. Perhaps the server would have one sending socket per connected client.

Since it seems like the outgoing UDP port isn’t an actual useful value, I have to keep track of the ports from within my protocol, so that two clients on a particular machine can work out their individual listen ports, relay that to the server, and the server will simply send the data to the appropriate ports after explicitly being informed of what they are.

Edit: Okay, I don’t want the “Use TCP” answer, even though it may be a valid answer. I’ll describe the application a little bit: I am controlling hardware remotely in real-time through the internet. I want there to be as little latency as possible, and TCP’s data integrity and in-order guarantees are simply not going to help. I just need somebody who is familiar with datagram based netcode to help me make sure that my approach is sane.

  • 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-20T04:43:42+00:00Added an answer on May 20, 2026 at 4:43 am

    Since UDP is stateless and lossy, are you sure it’s the right choice? Is there a reason you’ve chosen UDP over TCP?

    EDIT: What do you use when you need reliable UDP? may be worth a read if you haven’t seen it, various UDP-based options are discussed there which I think may be of use to you if you decide you definitely need to go down the UDP route.

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

Sidebar

Related Questions

I'm writing a UDP server, which is a first for me; I've only done
Designing my RESTful API, I would like use following URI http://[HOST]/[PLANET]/[LAT];[LONG] e.g. http://myserver/earth/50.2;29.1 What
When designing user table what would be the must have fields from the security/user
When designing a collection class, is there any reason not to implement locking privately
In designing any desktop applications, are there any general rules on how much memory
We are designing a p2p applications using c++ which transmits voice to other peer
I am designing a p2p application which works on port 30000. My router is
Designing a fairly complicated site with a lot of ajax running on a single
I'm designing help/hint system for my webpage, I'd like to incoroporate jQuery based contextual
Designing a new system from scratch. I'll be using the STL to store lists

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.