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

Re: [Libevent-users] UDP Event Dispatch



Hi Varun,

First, you are adding two listeners on the same socket.

I have another comment that you are using the old libevent API. Please
take a look at the online libevent book at:
http://www.wangafu.net/~nickm/libevent-book/

On Fri, Sep 27, 2013 at 2:03 AM, Varun Rapelly <varunrapelly@xxxxxxxxx> wrote:
> Hi,
>
> I'm newbie to libevent.
>
> Was trying to add multiple socket fds to event add. I'm able to read from
> only one socket.
>
> Following is pseudo code:
>
>     struct event ev, ev2;
>
>     event_init();
>     event_set(&ev, sock, EV_READ | EV_PERSIST, readEv, &ev);
>     event_add(&ev, NULL);
>     event_set(&ev2, sock, EV_READ | EV_PERSIST, readEv2, &ev2);
>     event_add(&ev2, NULL);
>     event_dispatch();
>
> Attached the file.
>
>
> Please help me to understand this.
> --
> Thanks & Regds
> ------------------------------------------------
> Varun Rapelly,
> 9620637186
>
>
>
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.