Re: [Libevent-users] [libevent-usr] When is a [regular file descriptor] readable or writable?

2011-08-03 Thread zhihua che
Hi, William Thanks for your quotation. It's really helpful and provide official proof of Andrew's opinion. I'll check it out further. Thanks for reply. Harvey 2011/8/4 William Ahern > On Wed, Aug 03, 2011 at 03:39:34PM +0800, zhihua che wrote: > > Hi, everyone, > > > > I'm reading lib

Re: [Libevent-users] [libevent-usr] When is a [regular file descriptor] readable or writable?

2011-08-03 Thread zhihua che
Hi Andrew, Thanks for your prompt. Moments ago, I wrote a client to open the .fifo file and write data to it and finally drive the event-loop run! I guess I must further my research into the kernel before I completely understand how epoll/select etc cooperate with file descriptor:( Thank

Re: [Libevent-users] [libevent-usr] When is a [regular file descriptor] readable or writable?

2011-08-03 Thread William Ahern
On Wed, Aug 03, 2011 at 03:39:34PM +0800, zhihua che wrote: > Hi, everyone, > > I'm reading libevent-2.0 code and have made certain progress:). However, > I'm still confused with some basic concepts like "ready" for reading or > writing. In the context of sockets, I think I can imagine this "r

Re: [Libevent-users] Patch: Propagate errors on SSL bufferevents

2011-08-03 Thread Nick Mathewson
On Tue, Jul 26, 2011 at 4:37 AM, Joachim Bauch wrote: > Hi, > > SSL bufferevents that use another bev as underlying source don't > propagate errors (like "connection closed") to the user. The > attached patch fixes this. Hm. Certainly, dropping the error can't be the right answer here, so I'm ap

Re: [Libevent-users] [libevent-usr] When is a [regular file descriptor] readable or writable?

2011-08-03 Thread Andrew W. Nosenko
On Wed, Aug 3, 2011 at 15:57, zhihua che wrote: > Hi, Adrian, >     Thanks for your reply. However, what you said makes me more confused:( >     You mean the mechanism behind libevent like epoll doesn't support > regular file descriptor? I'm not sure whether you're right, but looking into poll/se

Re: [Libevent-users] [libevent-usr] When is a [regular file descriptor] readable or writable?

2011-08-03 Thread zhihua che
Hi, Adrian, Thanks for your reply. However, what you said makes me more confused:( You mean the mechanism behind libevent like epoll doesn't support regular file descriptor? I'm not sure whether you're right, but looking into the application sample given by the libevent official website, h

Re: [Libevent-users] [libevent-usr] When is a [regular file descriptor] readable or writable?

2011-08-03 Thread Leonid Evdokimov
On Wed, Aug 3, 2011 at 11:39, zhihua che wrote: > Imagine I was monitoring a local regular file descriptor. I can't figure out > what actions or > conditions can cause the descriptor readable or writable. You probably want to look at AIO: man 3 aio_read Beware, this interface may have unexpected

Re: [Libevent-users] [libevent-usr] When is a [regular file descriptor] readable or writable?

2011-08-03 Thread Adrian Chadd
That's because it doesn't work that way for file backed file descriptors. There's no way to know a file is or isn't ready for writing, unless you had some way of defining (say) how much data is in the write buffer for that FD. Linux/FreeBSD at least don't supply this to you. Similarly, there's no

[Libevent-users] [libevent-usr] When is a [regular file descriptor] readable or writable?

2011-08-03 Thread zhihua che
Hi, everyone, I'm reading libevent-2.0 code and have made certain progress:). However, I'm still confused with some basic concepts like "ready" for reading or writing. In the context of sockets, I think I can imagine this "ready" situation: the socket is ready for reading when the receiving bu