*/
-#include <iostream>
-#include <vector>
-#include <string>
-#include <map>
#include "exitcodes.h"
#include "inspircd.h"
-#include "socketengine.h"
#include <sys/poll.h>
#include <sys/resource.h>
}
else
{
- ServerInstance->Logs->Log("SOCKET", LOG_DEFAULT, "ERROR: Can't determine maximum number of open sockets: %s", strerror(errno));
- std::cout << "ERROR: Can't determine maximum number of open sockets: " << strerror(errno) << std::endl;
- ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE);
+ // MAX_DESCRIPTORS is mainly used for display purposes, it's not a problem that getrlimit() failed
+ MAX_DESCRIPTORS = -1;
}
}
if (revents & POLLHUP)
{
- eh->HandleEvent(EVENT_ERROR, 0);
+ eh->OnEventHandlerError(0);
continue;
}
int errcode;
if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &errcode, &codesize) < 0)
errcode = errno;
- eh->HandleEvent(EVENT_ERROR, errcode);
+ eh->OnEventHandlerError(errcode);
continue;
}
if (revents & POLLIN)
{
eh->SetEventMask(eh->GetEventMask() & ~FD_READ_WILL_BLOCK);
- eh->HandleEvent(EVENT_READ);
+ eh->OnEventHandlerRead();
if (eh != GetRef(fd))
// whoops, deleted out from under us
continue;
// The vector could've been resized, reference can be invalid by now; don't use it
events[index].events = mask_to_poll(mask);
- eh->HandleEvent(EVENT_WRITE);
+ eh->eh->OnEventHandlerWrite();
}
}