This is a discussion on Network programming within the Linux Networking forums, part of the Linux Forums category; Hi NG, I'm trying to develop some application that communicate via the network. One application (say A) basically sends ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi NG,
I'm trying to develop some application that communicate via the network. One application (say A) basically sends a command to another (say B), which will reply with OK or NOT-OK. This is easy enough. The problem is that application B can also send messages on it's on initiative to application A. These are events based on actual hardware events. The requirements I have are that a command-reply sequence is blocking. So application A will wait until it gets a reply from application B. If an event is received a function should be called on a seperate thread. However application A will not continuously monitor the socket to see if events are received. So I think (pretty sure) that application A should have another thread that does monitor the socket continuously and notifies the main thread when a reply occurs. This seems a bit messy to me so I was wondering if there's a standard way of dealing with synchronous and asynchronous communication available? Can anyone give me some tips on how to continue? Thank Mark |