Before I start - my project is required to use POSIX standard. Anything else isn't permitted. Also I'm a beginner when it comes to UNIX/POSIX. So I may be doing simple mistakes.
I'm trying to create a program with a server, and few kinds of clients.
What I want to achieve is server (one program) being administered by a client applications (admin kind) while other types of clients only get constant message content (for instance whenever administrator changes configuration, clients get information about that) or if he requests he can get more details.
I'm planning few types of receiving clients but that's not the point since it's just separating who gets what.
My question is how to properly handle whole communication between administrator, server and other types of clients. I've decided to use TCP sockets (connect, accept), and wanted to use read/write functions but I have a problem with aministrator/server communication.
Currently I'm trying to fix my solution (both server and administrator constantly writing/reading in two separate threads each) but I'm not sure if I should stick with it, or look for something else (fi-fo pipe, some other function I'm not aware of).
Is write/read the correct way of handling communication in (badly) described case?
Best regards, Hisu
Aucun commentaire:
Enregistrer un commentaire