1
0

libevent: Enable IOCP backend on windows (#4745)

This commit is contained in:
peterbell10 2020-06-08 21:03:29 +01:00 committed by GitHub
parent 99d96337da
commit 6036971c77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,12 +75,15 @@ void cNetworkSingleton::Initialise(void)
#endif #endif
// Create the main event_base: // Create the main event_base:
m_EventBase = event_base_new(); event_config * config = event_config_new();
event_config_set_flag(config, EVENT_BASE_FLAG_STARTUP_IOCP);
m_EventBase = event_base_new_with_config(config);
if (m_EventBase == nullptr) if (m_EventBase == nullptr)
{ {
LOGERROR("Failed to initialize LibEvent. The server will now terminate."); LOGERROR("Failed to initialize LibEvent. The server will now terminate.");
abort(); abort();
} }
event_config_free(config);
// Create the event loop thread: // Create the event loop thread:
m_HasTerminated = false; m_HasTerminated = false;