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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:21:11+00:00 2026-06-01T21:21:11+00:00

In our application we have a server which will connect to multiple clients. For

  • 0

In our application we have a server which will connect to multiple clients. For your reference it is single threaded application . Whenever a client wants to send some message to other client it will go via the server. Whenever a client sends message to the server, it will store the message into a Dqueue. Server will extract messages one by one from the Dqueue and it will call select() and check whether the channel where the message is supposed to be sent is available or not. If yes it will send, otherwise it will insert it into the back so that we can process other messages.But problem with this approach is that, suppose client C1 sends two messages S1 and S2. Now when server tries to send S1 to other client C2, C2 was busy as a result it will push the message S1 into the back of the queue. Now Suppose while processing S2, client C2 is ready.So server can now send S2. But the problem with this is messages will reach to the C2 in reverse order (S2 S1).

Can you please suggest what data structure should be suitable for this so that we can maintain the same message order?

  • 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-01T21:21:13+00:00Added an answer on June 1, 2026 at 9:21 pm

    Don’t use a single queue to handle all messages. Each client needs its own individual queue. When a message arrives, determine the client it is destined for and put the message at the end of that client’s queue. Then update your server logic to send only the top message in a given client’s queue to that client. If the client is busy, dont’ send the top message. If the client is ready, send the top message and remove it from that clien’s queue.

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

Sidebar

Related Questions

we have an AIR application which is running in client-server mode as a desktop
In our application,we have a web service which wll return images to the client
I have an existing multi-threaded application which uses blocking connect() call. However, I want
We have to deploy our application on a Windows 2008 64 bit server. As
We have problem with our Qt based production server for our business application. When
We have several choices for logging in our .NET (C#) server application. We are
We have an n-tier web application that pulls data from SQL Server. Our Data
I am trying to connect to our exchange 2007 server. I have placed lots
I am implementing a python application that will connect to our different servers and
I have an ADO.NET connection object to an SQL Server (which will use connection

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.