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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:32:58+00:00 2026-06-11T02:32:58+00:00

I have multiple clients and a single server, which communicate object updates via TCP.

  • 0

I have multiple clients and a single server, which communicate object updates via TCP.

Basically the server runs an algorithm which accesses objects but these may be subject to change on upon an update send via TCP.

I have set flags to check for updates against the database and only send updates if there is a difference in data between the local memory or database server. The problem is if a change happens on an object while it is iterating.

The algorithm is run off a background thread and the code architecture summarised looks like the following, it is event driven:

Algorithm background thread:

Private algorithm As New NewAlgorithmTest
Private Sub bg_workerAlgorithm_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles bg_workerAlgorithm.DoWork

       algorithm.RunAlgorithm()
    End Sub

Private Sub bg_workerAlgorithm_RunWorkerCompleted(sender As System.Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles bg_workerAlgorithm.RunWorkerCompleted
    bg_workerAlgorithm.RunWorkerAsync()
End Sub

Tcp Message Recieved From Client:

Private Sub Client_MessageReceived(sender As Object, e As TcpClient.MessageRecievedEventArgs)
Dim message As String = e.Message
'figure out which object to update based off message and set it as updatedObject
dim updatedObject
updatedObject.GetLatest()
End Sub

How do I go about a solution to this problem?

  • 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-11T02:33:00+00:00Added an answer on June 11, 2026 at 2:33 am

    If you can’t block the thread until the iteration finishes, then I would implement a Stack<> (FIFO based) of the messages that are received.

    This will hold the messages as they come in. You can then fire off the background thread on each of these messages in turn ensuring that there is only ever one update that has fired off an iteration on your Db.

    Si

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

Sidebar

Related Questions

I have Client/Server System (using Socket) with multiple clients and single server, which is
I have a server that connects to multiple clients using TCP/IP connections, using C
In our application we have a server which will connect to multiple clients. For
If I have multiple Oracle clients installed on a given workstation (i.e. Oracle 9
i am doing a project that will have multiple channels for clients chatting. Each
We have a WCF service with multiple clients to schedule operations amongst clients. It
I have a WCF service that I am calling from multiple clients. I need
I have a class with a complex construction process with many parameters. Multiple clients
I have multiple clients: client 1 - 40 users client 2 - 50 users
I have a single Rails 2.2.2 app that I want to 'share' with multiple

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.