Are there any common patterns or general guidance I can learn from for how to design a client/server system where the both the client and server must maintain some kind per-client session state?
I've found any number of libraries that can help with some of the plumbing, but it's the overall design I'm wondering about.
Open issues in my mind:
- How to structure the client/server communication so that bidirectional synchronous and asynchronous requests are possible?
- The server side needs to spawn a couple of per-connected-client session-long helper process. How to manage that?
- How to manage the mapping from a given client (and any of it's requests) to server state and helper process instances in the face of multiple clients and intermittent network connectivity.
- Most communication can be simple blocking request/reply, but some will be long running processing tasks that the client will want to keep tabs on.
To the extent that it matters, the platform is Linux/C/C++. Not web based. Just an existing thick-client software app being modified to talk to backend servers for some tasks.