Re: Cancelling socket operations
Re: Cancelling socket operations
- Subject: Re: Cancelling socket operations
- From: Peter Sichel <email@hidden>
- Date: Mon, 5 Aug 2002 09:49:10 -0400
At 12:25 PM +0100 8/2/02, Tom Bayley wrote:
Hello all,
I'm trying to improve the way we manage things like time-outs and
abort requests in our TCP I/O classes. I think I've sussed the
time-out options - but I'm still not sure how to abort. I mean the
sort of situations where the user has decided a connection attempt
will fail and he/she/it doesn't want to hang around for the
time-out. Or perhaps the other end stops sending and again the user
wants to short-circuit the time-out.
What this seems to boil down to is some way of aborting select(). I
need to support threads so I don't really want to use signals,
especially since OS X doesn't appear to implement pthread_kill(). So
what is the recommended solution? Can I just close the socket from
another thread?
Tom
What I do is create a dummy pipe and include the output socket in the
corresponding select(). Then if I need to abort the select(),
I just write to the other end of the pipe so the select() returns
with data for my dummy socket.
- Peter
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.