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

Re: [Libevent-users] help about an error message





On Tue, Mar 26, 2013 at 10:44 AM, Nick Mathewson <nickm@xxxxxxxxxxxxx> wrote:
On Tue, Mar 26, 2013 at 10:41 AM, sven falempin <sven.falempin@xxxxxxxxx> wrote:
> Never saw
> i was used to libevent 1
> when i switch to 2

My guess is that you're setting up these events before constructing an
event_base or calling event_init. That might have worked with libevent
1, but in libevent 2, you need to make sure every event has an
event_base. ÂThe best way is to call one of the functions that creates
an event_base explicitly, and then use event_new or event_assign to
construct your events -- but you can still use event_init() and
event_set() like you did before, just so long as you call event_init()
first.

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


Thank you for input,
make me reread some doc:
event assign say:

Note that it is NOT safe to call this function on an event that is active or pending. Doing so WILL corrupt internal data structures in Libevent, and lead to strange, hard-to-diagnose bugs. You _can_ use event_assign to change an existing event, but only if it is not active or pending!

and i do not know why i was reassigning the same event.

works much better now i ASSIGN once and then del /add :-)

love libevent :-)

--
---------------------------------------------------------------------------------------------------------------------
() ascii ribbon campaign - against html e-mailÂ
/\Â