Re: Asynchronous sockets?
Re: Asynchronous sockets?
- Subject: Re: Asynchronous sockets?
- From: Becky Willrich <email@hidden>
- Date: Wed, 6 Feb 2002 16:12:22 -0800
Ah, run loop polling instead. I expect that all CFSocket does is call
select() in the run loop? I suppose that could be convenient for some
applications.
No; the run loop does not poll in the sense you mean. Each iteration of
the run loop, it looks for events that need to be dispatched. If none
are found, the run loop essentially puts that thread to sleep, and the
thread will not wake until it is told that an event has arrived (or a
timeout occurs, if the run loop was run with one). CFSocket does the
necessary magic to monitor its socket separately, and wake the run loop
if/when activity appears on the socket.
The distinction is, I suppose, minor, but it means the thread is
completely quiet (consuming no CPU) while waiting for events.
REW
_______________________________________________
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.