[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Q: Will listener FD receive regular EV_READ callbacks?



On Thu, Dec 6, 2012 at 6:51 AM, Mark Ellzey <mthomas@xxxxxxxxxx> wrote:
> On Wed, Dec 05, 2012 at 10:52:37PM +0000, Alexander Kolbasov wrote:
>> The libevent documentation mentions connection listeners that provide callback events for listener file descriptors.
>> My question is - if we register EV_READ callback on a listener file descriptor, will it get EV_READ events when a
>> new connection is arriving or the only way to work with listenets is via evconnlistener interface?
>>
>
> evconnlistener_new_bind, second argument is your accept callback. If
> there is an error on the socket after bufferevent_socket(), you set the
> 4th argument, the eventcb, and that is where the errors are passed.

That said, you _can_ also make a regular event that watches for
EV_READ events on a listener file descriptor.  That's how
evconnlistener is implemented internally.

-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.