You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Hans-Peter Weidinger <ha...@hp-weidinger.at> on 2006/10/04 10:18:15 UTC

Callbacks for async transfer with APR-Socket routines

Hi all

I hope this is not off topic in here ...
I'm currently working with the socket i/o routines provided by APR. I'm 
using the async-mode for a TCP-Stream-socket (client). Sending works 
fine - but i need a way to get notified, if sending is done.

I'd also appreciate if i get a notification, if the socket went down 
intermediately (e.g. the connection was interrupted).

Is there any way to register callbacks?
Is there any other way to accomplish this goal?

If this is off-topic: please tell me where i can get this information.

br

HPW

Re: Callbacks for async transfer with APR-Socket routines

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 10/4/06, Hans-Peter Weidinger <ha...@hp-weidinger.at> wrote:
> Hi all
>
> I hope this is not off topic in here ...
> I'm currently working with the socket i/o routines provided by APR. I'm
> using the async-mode for a TCP-Stream-socket (client). Sending works
> fine - but i need a way to get notified, if sending is done.

Umm, I think you're misunderstanding how non-blocking i/o works in
this case.  I'm not aware of any async mode for APR's sockets.  You
can make it non-blocking, in which case if you can't write the data it
won't get written, but you can't say "write this data, let me know
when it's done".  The traditional way of implementing the "write this
data let me know when it's done" kind of thing on top of non-blocking
sockets would be via select/poll, i.e. the apr_poll and apr_pollset
interfaces.

-garrett