if (EngineHandle == -1)
{
- ServerInstance->Log(SPARSE,"ERROR: Could not initialize socket engine: %s", strerror(errno));
- ServerInstance->Log(SPARSE,"ERROR: This is a fatal error, exiting now.");
+ ServerInstance->Logs->Log("SOCKET",SPARSE,"ERROR: Could not initialize socket engine: %s", strerror(errno));
+ ServerInstance->Logs->Log("SOCKET",SPARSE,"ERROR: This is a fatal error, exiting now.");
printf("ERROR: Could not initialize socket engine: %s\n", strerror(errno));
printf("ERROR: This is a fatal error, exiting now.\n");
ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE);
ref[fd] = eh;
port_associate(EngineHandle, PORT_SOURCE_FD, fd, eh->Readable() ? POLLRDNORM : POLLWRNORM, eh);
- ServerInstance->Log(DEBUG,"New file descriptor: %d", fd);
+ ServerInstance->Logs->Log("SOCKET",DEBUG,"New file descriptor: %d", fd);
CurrentSetSize++;
return true;
}
CurrentSetSize--;
ref[fd] = NULL;
- ServerInstance->Log(DEBUG,"Remove file descriptor: %d", fd);
+ ServerInstance->Logs->Log("SOCKET",DEBUG,"Remove file descriptor: %d", fd);
return true;
}
if (i == -1)
return i;
+ TotalEvents += nget;
+
for (i = 0; i < nget; i++)
{
switch (this->events[i].portev_source)
{
// reinsert port for next time around
port_associate(EngineHandle, PORT_SOURCE_FD, fd, POLLRDNORM, ref[fd]);
+ if ((this->events[i].portev_events & POLLRDNORM))
+ ReadEvents++;
+ else
+ WriteEvents++;
ref[fd]->HandleEvent((this->events[i].portev_events & POLLRDNORM) ? EVENT_READ : EVENT_WRITE);
}
}