Posted by David on February 06, 2006 at 20:49:40:
If possible, I'd like to use threads and blocking IO. However, I'd also like to be able to interrupt that IO from another thread so that I can gracefully terminate the connection. I'm running a server thread that spawns multiple connection threads. I ran into a problem where a server thread is waiting in nlAcceptConnection() and I'd like to stop that server. If I use nlClose() on that socket from another thread, it hangs (in a deadlock I assume), and nlShutdown() seems to free up that socket but isn't really a viable solution. I can implement this functionality using non-blocking IO, but then I lose the simplicity of blocking IO. Any pointers? I haven't really delved into the code to see if I can modify anything.