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


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

Posted by Phil Frisbie, Jr. on February 10, 2006 at 14:58:19:

In Reply to: Re: Interrupting a socket waiting on nlAcceptConnection() or nlRead()? posted by David on February 09, 2006 at 13:37:09:

: : :
: : : 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.

This issue has nothing to do with pthreads; it is a limitation of Berkeley sockets, and is well documented.

Now, after I have said all this about "don't do it", I think that I can code around this problem inside HawkNL because the HawkNL sockets are NOT Berkeley sockets, but they do contain the Berkeley socket descriptor inside. I believe I can code nlClose() so that this problem is eliminated.

: : 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?

Yes, but I am TRYING to get another version out, of course with this new fix.

Thank you for making me think about this!

Phil



Follow Ups:


Post a Followup

Name:
E-Mail:

Subject:

Comments:



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