On 4/24/07, Anders Persson <[EMAIL PROTECTED]> wrote:
> - I think the ksock_callback_t passed to ksock_accept() is slightly
> confusing. Is it really necessary for an accepted socket to
> immediately have callbacks? It would be more straightforward if the
> thread calling ksock_accept() simply called ksock_callback() upon its
> return.
The issue with that is that an event might be missed, and the user would
have to check for "pending" events after registering the callbacks. The
current approach allows the user to do what you want by simply passing
in NULL for the last two arguments. Another approach would be to provide
two versions of accept; one that has the "regular" accept behavior, and
another that allows for callback registration.

This yeilds another question then. When I add a callback function to
an existing socket using ksock_callback() do I not get notification of
pending events? I.e. if the socket is connected and already has data,
do I not get told about that?

 Paul

--
Paul Durrant
http://www.linkedin.com/in/pdurrant
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to