Re: Asynchronous sockets?
Re: Asynchronous sockets?
- Subject: Re: Asynchronous sockets?
- From: Vincent Lubet <email@hidden>
- Date: Wed, 6 Feb 2002 16:34:11 -0800
On the sockets side of the house, there are solutions do not require
polling and do not have the drawbacks of select() for large file
descriptor sets.
For example, FreeBSD has the kqueue mechanism but we haven't adopted it
in Darwin.
So, for a pure sockets based solution, you are left with select().
By the way Thomas, select() does not poll, it wakes up your thread as
soon as an event occurs for one of the file descriptor in the file
descriptor set. Why do you use a 0,0 timeout?
Vincent
On Wednesday, February 6, 2002, at 03:40 PM, Duane Murphy wrote:
--- At Thu, 7 Feb 2002 00:20:03 +0100, Tomas Zahradnicky, Jr. wrote:
Hello,
I'd like to create asynchronous socket or at least something similar
to OT notifier function to be notified of incoming data. I know I can
use select with 0,0 timeout value to poll for data, but I'd really
like to know when data income to fill them into my buffer to not poll
every moment for an incoming data. Is there a way how to get notified
of incoming data just like in OT?
So, I'd like to do it synchronously and when data arrieves, just it
in a buffer and I what I don't want to is to poll.
I will second this request for a technique.
I have been scanning Steven's looking for a solution. The only
solution I
have seen uses threads. The fundamental problem with this is how to
clean
up the thread nicely. Aborting a thread is the equivalent of kill -9; No
hope to clean anything up, just recover the memory and move on.
Suggestions are very welcome from the experienced Unix side of the
house. :-)
...Duane
_______________________________________________
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.
_______________________________________________
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.