Re: Interrupting a socket waiting on nlAcceptConnection() or nlRead()?


[ Follow Ups ] [ Post Followup ] [ Back To Message Board ]

Posted by David on February 09, 2006 at 13:37:09:

In Reply to: Re: Interrupting a socket waiting on nlAcceptConnection() or nlRead()? posted by Phil Frisbie, Jr. on February 09, 2006 at 09:42:01:

: :
: : But then what's the accepted way to interrupt a thread blocking on IO?
:
: If you are not shutting down the program then there is none.

Hmmm, well I'm no pthread expert, but that doesn't make sense. If the OS can do it, then the application must also have some sort of access to it as well.

: If you upgrade your version of HawkNL you can use nlPollSocket() to impose a timeout so you can cleanly end the thread if you wish.

Yea, I see all those options you talked about are in 1.7. Is that relatively stable? I have a hard enough time finding bugs in my own code :)

I looked at nlPollSocket() ... do you use that instead of nlRead() on blocking sockets? So you block but end up returning after X amount of time.


It looks like I'll just use async sockets to accomplish what I need.





Follow Ups:


Post a Followup

Name:
E-Mail:

Subject:

Comments:



[ Follow Ups ] [ Post Followup ] [ Back To Message Board ]