Discussion:
Replacement for event_init?
Jeffrey Walton
2014-02-20 17:16:26 UTC
Permalink
http://www.wangafu.net/~nickm/libevent-book/Ref2_eventbase.html states
that event_init is obsolete. But it does not state what should be
called in its place (and the source code appears to continue using
it).

I found a shutdown function in libevent_global_shutdown. But I did not
find a libevent_global_startup to match libevent_global_shutdown.

What function should be called for initialization?

Thanks in advance.
***********************************************************************
To unsubscribe, send an e-mail to ***@freehaven.net with
unsubscribe libevent-users in the body.
Yucong Sun
2014-02-20 17:37:12 UTC
Permalink
event_base_new() , and be sure to only use functions that accept a
event_base* param
Post by Jeffrey Walton
http://www.wangafu.net/~nickm/libevent-book/Ref2_eventbase.html states
that event_init is obsolete. But it does not state what should be
called in its place (and the source code appears to continue using
it).
I found a shutdown function in libevent_global_shutdown. But I did not
find a libevent_global_startup to match libevent_global_shutdown.
What function should be called for initialization?
Thanks in advance.
***********************************************************************
unsubscribe libevent-users in the body.
Scott Dorr
2014-02-20 17:36:14 UTC
Permalink
That same page tells you to use event_base_new() instead.

Any calls that assume a default/current base instead of explicitly calling out a base have been deprecated. So, instead of using ‘event_init()’ which is non-specific, use ‘event_base_new()’ for each event base you’d like to set up.

- scott
Post by Jeffrey Walton
http://www.wangafu.net/~nickm/libevent-book/Ref2_eventbase.html states
that event_init is obsolete. But it does not state what should be
called in its place (and the source code appears to continue using
it).
I found a shutdown function in libevent_global_shutdown. But I did not
find a libevent_global_startup to match libevent_global_shutdown.
What function should be called for initialization?
Thanks in advance.
***********************************************************************
unsubscribe libevent-users in the body.
***********************************************************************
To unsubscribe, send an e-mail to ***@freehaven.net with
unsubscribe libevent-users in the body.
Jeffrey Walton
2014-02-20 19:25:20 UTC
Permalink
Thanks gentleman.

So I'm clear: there is no *_init() function. I just start using the
library and everything just works.
Post by Scott Dorr
That same page tells you to use event_base_new() instead.
Any calls that assume a default/current base instead of explicitly calling out a base have been deprecated. So, instead of using ‘event_init()’ which is non-specific, use ‘event_base_new()’ for each event base you’d like to set up.
- scott
Post by Jeffrey Walton
http://www.wangafu.net/~nickm/libevent-book/Ref2_eventbase.html states
that event_init is obsolete. But it does not state what should be
called in its place (and the source code appears to continue using
it).
I found a shutdown function in libevent_global_shutdown. But I did not
find a libevent_global_startup to match libevent_global_shutdown.
What function should be called for initialization?
Thanks in advance.
***********************************************************************
unsubscribe libevent-users in the body.
***********************************************************************
unsubscribe libevent-users in the body.
***********************************************************************
To unsubscribe, send an e-mail to ***@freehaven.net with
unsubscribe libevent-users in the body.
Scott Dorr
2014-02-20 19:43:23 UTC
Permalink
event_base_new() does all the initialization you need to use that base.

- scott
Post by Jeffrey Walton
Thanks gentleman.
So I'm clear: there is no *_init() function. I just start using the
library and everything just works.
Post by Scott Dorr
That same page tells you to use event_base_new() instead.
Any calls that assume a default/current base instead of explicitly calling out a base have been deprecated. So, instead of using ‘event_init()’ which is non-specific, use ‘event_base_new()’ for each event base you’d like to set up.
- scott
Post by Jeffrey Walton
http://www.wangafu.net/~nickm/libevent-book/Ref2_eventbase.html states
that event_init is obsolete. But it does not state what should be
called in its place (and the source code appears to continue using
it).
I found a shutdown function in libevent_global_shutdown. But I did not
find a libevent_global_startup to match libevent_global_shutdown.
What function should be called for initialization?
Thanks in advance.
***********************************************************************
unsubscribe libevent-users in the body.
***********************************************************************
unsubscribe libevent-users in the body.
***********************************************************************
unsubscribe libevent-users in the body.
***********************************************************************
To unsubscribe, send an e-mail to ***@freehaven.net with
unsubscribe libevent-users in the body.
Jeffrey Walton
2014-02-20 19:51:27 UTC
Permalink
Post by Scott Dorr
event_base_new() does all the initialization you need to use that base.
Thanks Scott.

Forgive my ignorance here. Does the library need to be initialized
(beyond base initialization)? If so, what is the function (I can only
find the deprecated/obsolete function).

I probably should have stated this earlier: I'm using 2.0.21-stable.

Another question (if you'll forgive the transgression): what is the
official email address for the list? I noticed two are in play
(freehaven.net and seul.org).

Jeff
Post by Scott Dorr
Post by Jeffrey Walton
Thanks gentleman.
So I'm clear: there is no *_init() function. I just start using the
library and everything just works.
Post by Scott Dorr
That same page tells you to use event_base_new() instead.
Any calls that assume a default/current base instead of explicitly calling out a base have been deprecated. So, instead of using ‘event_init()’ which is non-specific, use ‘event_base_new()’ for each event base you’d like to set up.
- scott
Post by Jeffrey Walton
http://www.wangafu.net/~nickm/libevent-book/Ref2_eventbase.html states
that event_init is obsolete. But it does not state what should be
called in its place (and the source code appears to continue using
it).
I found a shutdown function in libevent_global_shutdown. But I did not
find a libevent_global_startup to match libevent_global_shutdown.
What function should be called for initialization?
Thanks in advance.
***********************************************************************
To unsubscribe, send an e-mail to ***@freehaven.net with
unsubscribe libevent-users in the body.
Scott Dorr
2014-02-21 03:42:27 UTC
Permalink
Post by Jeffrey Walton
Post by Scott Dorr
event_base_new() does all the initialization you need to use that base.
Thanks Scott.
Forgive my ignorance here. Does the library need to be initialized
(beyond base initialization)? If so, what is the function (I can only
find the deprecated/obsolete function).
No.
Post by Jeffrey Walton
I probably should have stated this earlier: I'm using 2.0.21-stable.
Another question (if you'll forgive the transgression): what is the
official email address for the list? I noticed two are in play
(freehaven.net and seul.org).
I typically use freehaven. I’m not sure why there’s two addresses. :)


- scott***********************************************************************
To unsubscribe, send an e-mail to ***@freehaven.net with
unsubscribe libevent-users in the body.

Loading...