Hello.
You might want to try ns_sockselect -timeout for handling timeouts.
That's NOT what ns_event is for (at least for me :).
Also, you might use fileevent+vwait+after to handle timeouts on a
separate thread (event driven programming has many advantages over
thread-per-connection programming).
I'm using ns_event to call my child thread when it has something to do -
in a small mail->sms project (yes, I'm using AOLserver for that :).
Threads are ns_event wait'ing, then each one fetches one new sms to send
to the specified GSM operator (each thread is handling one operator).
I wouldn't like to make this code public since my company is using it
and for now it has some minor bugs which allow DoS attacks.
Basically the mainloop for sending threads is
while {1} {
# do stuff
ns_event wait $opevt(e.$op) $opevt(m.$op) $retrytime
}
opevt is an array for storing stuff for sending threads. e.$op element
is the event id from ns_event create, m.$op is a mutex for this operator
- I'm not sure what is this mutex for ;)
--
WK