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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:21:03+00:00 2026-05-13T08:21:03+00:00

(Edited to try to explain better) We have an agent, written in C++ for

  • 0

(Edited to try to explain better)

We have an agent, written in C++ for Win32. It needs to periodically post information to a server. It must support disconnected operation. That is: the client doesn’t always have a connection to the server.

Note: This is for communication between an agent running on desktop PCs, to communicate with a server running somewhere in the enterprise.

This means that the messages to be sent to the server must be queued (so that they can be sent once the connection is available).

We currently use an in-house system that queues messages as individual files on disk, and uses HTTP POST to send them to the server when it’s available.

It’s starting to show its age, and I’d like to investigate alternatives before I consider updating it.

  1. It must be available by default on Windows XP SP2, Windows Vista and Windows 7, or must be simple to include in our installer.
    This product will be installed (by administrators) on a couple of hundred thousand PCs. They’ll probably use something like Microsoft SMS or ConfigMgr. In this scenario, “frivolous” prerequisites are frowned upon. This means that, unless the client-side code (or a redistributable) can be included in our installer, the administrator won’t be happy. This makes MSMQ a particularly hard sell, because it’s not installed by default with XP.

  2. It must be relatively simple to use from C++ on Win32.
    Our client is an unmanaged C++ Win32 application. No .NET or Java on the client.

  3. The transport should be HTTP or HTTPS. That is: it must go through firewalls easily; no RPC or DCOM.
  4. It should be relatively reliable, with retries, etc. Protection against replays is a must-have.
  5. It must be scalable — there’s a lot of traffic. Per-message impact on the server should be minimal.
  6. The server end is C#, currently using ASP.NET to implement a simple HTTP POST mechanism.
  7. (The slightly odd one). It must support client-side in-memory queues, so that we can avoid spinning up the hard disk. It must allow flushing to disk periodically.
  8. It must be suitable for use in a proprietary product (i.e. no GPL, etc.).
  • 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-13T08:21:03+00:00Added an answer on May 13, 2026 at 8:21 am

    How is your current solution showing its age?

    I would push the logic on to the back end, and make the clients extremely simple.

    1. Messages are simply stored in the file system. Have the client write to c:/queue/{uuid}.tmp. When the file is written, rename it to c:/queue/{uuid}.msg. This makes writing messages to the queue on the client “atomic”.

    2. A C++ thread wakes up, scans c:\queue for “*.msg” files, and if it finds one it then checks for the server, and HTTP POSTs the message to it. When it receives the 200 status back from the server (i.e. it has got the message), then it can delete the file. It only scans for *.msg files. The *.tmp files are still being written too, and you’d have a race condition trying to send a msg file that was still being written. That’s what the rename from .tmp is for. I’d also suggest scanning by creation date so early messages go first.

    3. Your server receives the message, and here it can to any necessary dupe checking. Push this burden on the server to centralize it. You could simply record every uuid for every message to do duplication elimination. If that list gets too long (I don’t know your traffic volume), perhaps you can cull it of items greater than 30 days (I also don’t know how long your clients can remain off line).

    This system is simple, but pretty robust. If the file sending thread gets an error, it will simply try to send the file next time. The only time you should be getting a duplicate message is in the window between when the client gets the 200 ack from the server and when it deletes the file. If the client shuts down or crashes at that point, you will have a file that has been sent but not removed from the queue.

    If your clients are stable, this is a pretty low risk. With the dupe checking based on the message ID, you can mitigate that at the cost of some bookkeeping, but maintaining a list of uuids isn’t spectacularly daunting, but again it does depend on your message volume and other performance requirements.

    The fact that you are allowed to work “offline” suggests you have some “slack” in your absolute messaging performance.

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

Sidebar

Related Questions

I have HTML code edited by FCKEditor stored in a database and would like
I have a JavaScript resource that has the possibility of being edited at any
can anybody explain why uploaded php files treated by a server as a text
Every time I try to post to twitter in my rails app, the first
I have edited several files ISO-8859-15 encoded php source files with netbeans 6.7.1, but
Setup: firebirdsql 2.1.3 win32, php 5.3 (installed with xampp) When I try to update
Problem: edited files on windows, using git-bash, to fix IE7 problems committed, pushed to
I edited the question after David Hanak's answer (thanks btw!). He helped with the
This is a sample (edited slightly, but you get the idea) of my XML
How do I load the edited .emacs file without restarting Emacs?

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.