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

Re: [Libevent-users] event_add fails with ENOENT when on epoll



On Tue, Apr 20, 2010 at 5:24 AM, Denis Bilenko <denis.bilenko@xxxxxxxxx> wrote:
> Hi,
>
> I've run into an issue where event_add() fails with ENOENT.
> This happens when a socket reuses a descriptor that was recently
> closed and was used before with another event.
>
> The details are below. The question I have is - what are the ways to
> work around this?

Make sure you delete the event with event_del() if you did infact add
it with event_add()?

>    event_set(&server_event, server_socket, EV_READ, NULL, NULL);
>    if (event_add(&server_event, NULL))
>        perror("event_add(server_event)");

Here.

>    close(server_socket);

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