| I have a network device. The network device is tied into an event
flag. I'm going to wait for that event flag and then I'm to process
my network activity, so I'm blocked on that event flag.
Now, I don't want to poll for my network QIO because it makes me
do an XT_pending (a nonblocking xt_next_event). I want to use
XT$add_input but I don't know how to use a network channel number as a
the source argument for XT$add_input.
tim
|
|
If the interface to the network socket is $QIO, then you can use the
asynchronous form ($QIO and not $QIOW), preferably with an IOSB, and
use the event flag in XtAddInput/XtNextEvent to sense when the network
operation is "probably" complete. I say probably because you may be
using the event flag for other purposes in your application which will
could cause false generation of events from XtNextEvent. If you are
using the event flag exclusively for this socket, then the event is
reliable. Now, if the interface *doesn't* use $qio or other
asynchronous interface, I hope it provides some way of generating an
AST when input arrives or output is possible. Then, the ast routine
can set some event flag to be used as above. If the interface only has
a synchronous interface, you're quickly placing yourself between a rock
and a hard place.
m
|