Accessor function to get a listener's associated fd

svn:r1390
This commit is contained in:
Nick Mathewson 2009-07-30 17:00:56 +00:00
parent 625116295a
commit 75fe762e03
3 changed files with 10 additions and 1 deletions

View File

@ -4,7 +4,7 @@ Changes in 2.0.3-alpha:
o Avoid segfault during failed allocation of locked evdns_base. (Found by Rocco Carbone.)
o Export new evutil_ascii_* functions to perform locale-independent character type operations.
o Try to compile better with MSVC: patches from Brodie Thiesfield
o New evconnlistener_get_fd function to expose a listener's associated socket.
Changes in 2.0.2-alpha:
o Add a new flag to bufferevents to make all callbacks automatically deferred.

View File

@ -105,4 +105,7 @@ int evconnlistener_disable(struct evconnlistener *lev);
/** Return an evconnlistener's associated event_base. */
struct event_base *evconnlistener_get_base(struct evconnlistener *lev);
/** Return the socket that an evconnlistner is listening on. */
evutil_socket_t evconnlistener_get_fd(struct evconnlistener *lev);
#endif

View File

@ -153,6 +153,12 @@ evconnlistener_get_base(struct evconnlistener *lev)
return event_get_base(&lev->listener);
}
evutil_socket_t
evconnlistener_get_fd(struct evconnlistener *lev)
{
return event_get_fd(&lev->listener);
}
static void
listener_read_cb(evutil_socket_t fd, short what, void *p)
{