Creating a map that can be accessed by multiple clients

I have created an asynchronous TCP server (local) which accepts multiple clients. I have created a map class where client can set a value pair, retrieve it and delete it. My question is how can I make this map class accessible to all clients i.e. only one copy of this map class is created when the server initializes and all the clients can add/modify values in that one class so that anything that has been added or modified is visible to all clients?

Thanks in advance
P.S. I am a beginner in C++ so maybe I’m missing a very basic concept.


Source: c++

Leave a Reply