[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] EV_WRITE - Wait for a socket or FD to become writeable.
- To: libevent-users@xxxxxxxxxxxxx
- Subject: [Libevent-users] EV_WRITE - Wait for a socket or FD to become writeable.
- From: Parvez Shaikh <pshaikh.world@xxxxxxxxx>
- Date: Fri, 31 Aug 2012 11:20:54 +0530
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Fri, 31 Aug 2012 01:50:59 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Dn1H+v7bHqX2VZiN6gc4lcI6AylIqDYcpTwNGD3mCEo=; b=KguRVxkX8CPoVf8jw5rUkrLCUr9dlTw3aaaCK+GrTRKK1eeFQYLxek2/PmYygPMCIh 30W2W6xnOlQfqPlTZq1dxmiVRfJYmB6zBLnaXkoEBk+++xJre3DkShugQZMH/2OETCGd yPKJVQm5yvuVDF8bfvXWG9okVnBdPMjd112vmmv4MIEnqxg6L+rOT5VJv779JJcniR+k +og74DFTXCMq0S0QlwqrOw4H52caYEi5a6ZqoZ2HagsmLtFsmxEQM4JGu6Hez7NE7eEl r6dCyBtTS2JsND/xegMlPsbeLYTmRMVh/Fsl/JdVd1m+8XEKDHrDBohTidl6NwTAGjXr 2XXA==
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
Hi all,
I have a question about EV_WRITE event as to when does it's callback function invoked?
Is it that when someone first executes write on an fd associated with EV_WRITE event?
Or when libevent detects that application can now write to fd without getting errors?
For EV_READ it is easy to understand that it's callback is invoked when data is available for read on fd but not clear about EV_WRITE.
Here is what I am trying to do -
I am trying to write asynchronous send/recv application; in which I will read data on connected sockets asynchronously using "EV_READ's callback.
For send however, I will enqueue the data to be sent in my own queue(application will write data to this buffer) and I will flush the buffer in EV_WRITE callback.
Now if I get the error EAGAIN in send operation in callback of EV_WRITE, I will simply return and on next invocation of EV_WRITE's callback I will start flushing my buffer again.
Thanks,
Parvez