More work on epoll.

This commit is contained in:
Jan Vidar Krey
2010-01-17 22:59:51 +01:00
parent 6a4b9c58f4
commit 1c58a85de1
12 changed files with 160 additions and 58 deletions

View File

@@ -21,9 +21,7 @@
static int is_ipv6_supported = -1; /* -1 = CHECK, 0 = NO, 1 = YES */
static int net_initialized = 0;
#ifdef USE_LIBEVENT
static struct event_base* net_evbase = 0;
#endif
static struct net_statistics stats;
static struct net_statistics stats_total;
@@ -49,16 +47,7 @@ int net_initialize()
}
#endif /* WINSOCK */
#ifdef USE_LIBEVENT
net_evbase = event_init();
if (!net_evbase)
{
LOG_ERROR("Unable to initialize libevent.");
return 0;
}
LOG_DEBUG("Using libevent %s, backend: %s", event_get_version(), event_get_method());
#endif
net_backend_initialize();
net_stats_initialize();
#ifdef SSL_SUPPORT
@@ -102,11 +91,8 @@ int net_destroy()
{
LOG_TRACE("Shutting down network monitor");
#ifdef USE_LIBEVENT
event_base_free(net_evbase);
net_evbase = 0;
#endif
net_backend_shutdown();
#ifdef SSL_SUPPORT
/* FIXME: Shutdown OpenSSL here. */
#endif