Hello guys!
I'm having a little bit of struggle understanding how complex Ca /C++ concurrent servers should work. I have to do a project for faculty and I have a list of projects from where I can choose but I have no idea how should I implement any of them.
For example, I can understand how simple concurrent servers work, like when a client connects, I accept that connection on a child process, I deal with that client and I close the connection.
The problems start to appear when my clients won't be disconnected after doing a single action and need to interact between them.
What kind of data structures should I use so that the clients can communicate between them. Should I keep a global array with their descriptors or how can I assure that the server remains concurrent.
For example, a chat application. A client is accepted by a child but obviously they will need to send messages to another clients in different rooms. Or a chess game, a child will accept 1 client but the game won't start until we have 2 of them.What do I do then? And if I wait for a second client, what process will be the server which will assure the communication between them?
I know I sound like a retarded person, but it's getting really frustrating. I passed exams for C#, C++, Java, Php, Html, Css, Sql and others but it's the 3rd year when I'm trying to do something with linux programming and I fail, reason why I can't get my Computer Science license.29 passed exams and this is stopping me. Probably it's a psychological blockage but I really need to understand at least in theory how this should work. Any links or explanation would be very helpful. Thank you.