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

Re: [Libevent-users] Regarding info about Libevent configuration



Hi,

Thanks for your valuable input.


I need few more information about removing event from event list.


1. currently I'm using event_free() for cleaning events. Is this fine or any other call is available to remove particular event?


2. When I try to create an event with event_new() of a socket id(accepted client ), in-case already event was created for same socket id. Why event_new is not throwing any error and its creating new event with that id again?



Regards
Sakthivel S




From: owner-libevent-users@xxxxxxxxxxxxx <owner-libevent-users@xxxxxxxxxxxxx> on behalf of Azat Khuzhin <a3at.mail@xxxxxxxxx>
Sent: Saturday, March 18, 2017 6:53 PM
To: libevent-users@xxxxxxxxxxxxx
Subject: Re: [Libevent-users] Regarding info about Libevent configuration
 
On Fri, Mar 17, 2017 at 7:26 AM, Sakthivel Subramaniam
<Sakthivel.s@xxxxxxxxxxxx> wrote:
>
> Hi,
>
> I'm new to libevent and I have the code changes with libevent functions. My
> program was working fine upto 1000 client connections (events).
>
> when I try to connect 2000 cilents, its failing and can see message losses.
>
>
> 1.Can you please et me know, is any limitation for total number events/ how
> can we modify number of max events?

Hi,

I guess that you have limit for number of opened files installed to ~1024.
Take a look at setrlimit(RLIMIT_NOFILE) (if you run your program from
root you can install it there) or  "ulimit -n" from shell.

> 2. I have created an event with event_new() with EV_READ. After some time I
> want to change this event to EV_WRITE. what should I do for this? Is there
> any modify function is available?

No, just use
- event_del()
- event_assign()
- event_add()

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