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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:07:55+00:00 2026-05-20T12:07:55+00:00

Working with an API that can handle multiple connections (i.e. sessions), each of these

  • 0

Working with an API that can handle multiple connections (i.e. sessions), each of these sessions has a uniqueID (sessionID) and keeps track of all inbound and outbound messages via sequence numbers.

Class1

public void Method1(SessionID sessionID, Message message)
{       
    var ID = sessionID;
    var foo = message.InSeqNo;
}

public void Method2(SessionID sessionID, Message message)
{
    var ID = SessionID;
    var bar = message.OutSeqNo;
}

I’m curious how would you recommend storing this data together so each instance can be displayed independently based on its sessionID.

There is no need to store previous numbers because they are only displayed.
None of the SessionIDs will change and each sequence number will update independently.

The best thing I can think of is using two separate fields like Dictionary<sessionID, number>, .Clear each field on update, re-add with new values, then join the two via LINQ and display the information.

  • 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-20T12:07:56+00:00Added an answer on May 20, 2026 at 12:07 pm

    Why not a single class that contains the inbound and outbound sequence numbers for a particular ID?

    class SessionInfo
    {
        public int SessionId { get; private set; }
        public int InSeqNo { get; set; }
        public int OutSeqNo { get; set; }
    }
    

    Dictionary Sessions = new Dictionary();

    To update a session’s InSeqNo, then:

    SessionInfo sess;
    if (Sessions.TryGetValue(sessionId, out sess))
    {
        ++sess.InSeqNo;
    }
    

    Or am I missing something fundamental in your question?

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

Sidebar

Related Questions

I'm working on a Python library that interfaces with a web service API. Like
I'm working on a largely navigation-based iPhone app that communicates with a REST API
I'm working with a Matlab API that loads data from a proprietary format into
I'm working this API and there is a factory method that sets the current
I've been working with the SpiderMonkey C API and would like to implement a
We're working now on the design of a new API for our product, which
I have recently started working with Unified Communication Managed API 2.0 (UCMA) and Office
I'm currently working on desktop application which calls third party API. After authorizing against
I'm working on the development of a C++ API which uses custom-designed plugins to
I'm getting started on building a REST API for a project I'm working on,

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.