jono
June 20th, 2004, 04:25 PM
hi everybody. im new here, but if anybody can help me w/ this, i promise to return. :-)
under unix it is possible (altho i havent tried it) to interrupt a blocking select() call by raising a signal in the process that owns the call. unfortunately, winsock doesnt have this capability.
the server i'm writing mainly connects to clients on localhost, but needs to respond in real time & not suck cycles. if i accept a connection from a new client, the request is serviced in a separate thread, and the server continues listening.
the problem is that once the new thread is active, i need to reset the fd_set so that select responds to i/o on that socket. a non blocking select call in a loop is too inefficient. what i need is to be able to cancel the current select call when the new thread is ready for input, at which point the server will fall thru the loop & do the appropriate book keeping.
DOES ANYBODY KNOW A WAY OF DOING THIS?
...ive tried the signal scenario. ive also tried calling select again, & even sending data from the server back to itself on another socket (im not sure why that doesnt work... any ideas?)
cheers
jono
under unix it is possible (altho i havent tried it) to interrupt a blocking select() call by raising a signal in the process that owns the call. unfortunately, winsock doesnt have this capability.
the server i'm writing mainly connects to clients on localhost, but needs to respond in real time & not suck cycles. if i accept a connection from a new client, the request is serviced in a separate thread, and the server continues listening.
the problem is that once the new thread is active, i need to reset the fd_set so that select responds to i/o on that socket. a non blocking select call in a loop is too inefficient. what i need is to be able to cancel the current select call when the new thread is ready for input, at which point the server will fall thru the loop & do the appropriate book keeping.
DOES ANYBODY KNOW A WAY OF DOING THIS?
...ive tried the signal scenario. ive also tried calling select again, & even sending data from the server back to itself on another socket (im not sure why that doesnt work... any ideas?)
cheers
jono