Solved A problem with accept and kevent

Is there a regular way to interrupt a blocking call to accept? I've tried closing the listening socket on a different thread but accept continues waiting. Furthemore it accepts the first connection and only fails on the second.

The same with a blocking call to kevent. It fails only on the second event after closing the queue. How am I expected to break the vicious loop in the example on this page:

kqueue(2)?
 
Back
Top