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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:36:20+00:00 2026-05-28T00:36:20+00:00

I am faced with a situation to maintain multiple timers in my socket communication

  • 0

I am faced with a situation to maintain multiple timers in my socket communication program in C language. I have a client server program where both the client and the server ought to maintain a timer for every packet it send to the other machine.
The protocol I am works like this-
Every packet that machine A sends, machine B must acknowledge the same in a certain time. So a timer has to be there for every packet that machine A sends. If the timer senses timeout the socket connection must close.
This way I need to maintain timers for each and every packet. The time for time-out is same for all the packets. I am looking to know if there is any provision in C to set different timers and distinguish among them to achieve the functionality above.

  • 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-28T00:36:21+00:00Added an answer on May 28, 2026 at 12:36 am

    Instead of multiple timers, you can have one timer and a queue of “events”. The queue is ordered by the time of the events. So when you send a packet, just add a disconnect-event to the event queue, and store some identifier to that event. If you receive a reply before the event fires, then remove the event from the queue.

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

Sidebar

Related Questions

I have faced with a situation in VB.NET and C# (.NET2) with the visibility
I have faced a very strange situation here. I am accessing database (MDB) through
I've faced such situation. I've used to program in C#, and such code: if
I've faced with situation when I need to have EF readonly property in case
i'm faced with a situation, where i have to find the best matches for
On several occations, I have faced the situation that the default.aspx page on a
I'm faced with a situation where I have two tables: A and B. B
I faced a problem - I need to use a macro value both as
I have faced this problem quite often during the last couple of months, during
I am currently faced with a difficult sorting problem. I have a collection 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.