*/
#include "socketengine_iocp.h"
+#include "exitcodes.h"
#include <mswsock.h>
IOCPEngine::IOCPEngine(InspIRCd * Instance) : SocketEngine(Instance)
/* Create completion port */
m_completionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, (ULONG_PTR)0, 0);
+ if (!m_completionPort)
+ {
+ ServerInstance->Log(SPARSE,"ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features.");
+ ServerInstance->Log(SPARSE,"ERROR: this is a fatal error, exiting now.");
+ printf("ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features.");
+ printf("ERROR: this is a fatal error, exiting now.");
+ InspIRCd::Exit(EXIT_STATUS_SOCKETENGINE);
+ }
+
/* Null variables out. */
CurrentSetSize = 0;
EngineHandle = 0;
int opt_len = sizeof(int);
/* In range? */
- if ((fake_fd < 0) || (fake_fd > MAX_DESCRIPTOR))
+ if ((fake_fd < 0) || (fake_fd > MAX_DESCRIPTORS))
return false;
/* Already an entry here */
void IOCPEngine::PostReadEvent(EventHandler * eh)
{
if (!eh)
- return false;
+ return;
Overlapped * ov = new Overlapped(SOCKET_IO_EVENT_READ_READY, 0);
DWORD flags = 0;