6TTW014
6TTW014

Reputation: 627

Multi-Client Server communication when server is offline

So I want to create a Multi-Client/Server application. I know multiple clients can connect through one port, and I want to allow for the messages to be stored in a list when the server is "offline". I'm having trouble finding information online to help me understand how the server can tell the difference between the multiple clients on the port. For example, if a 2 clients send messages to the server while it is offline and I store them in a list, how would I be able to tell the server that this message came from this client first so answer that, and then this message came from this client next? Is there any information online on an easy way to achieve this? Any help would be greatly appreciated.

Sorry, I didn't make it very clear. I'll try again! Ok basically I want like a middleware between them so that the clients contact the middleware with the message, the middleware checks if the server is online and if so it sends it on, otherwise it will store the message(s) until the server is connected again. Does this make more sense? I'm not great at explaining myself, sorry again!

Upvotes: 0

Views: 472

Answers (1)

There seems to be some confusion of concepts here. When client are not connected they obviously can't send anything to the server and also don't have a port. Conversely, when the server is running and clients connect to it, the server has an object for each connection, representing each client.

Upvotes: 1

Related Questions