#include <vector>
#include <string>
#include "socketengine.h"
+#include "helperfuncs.h"
char ref[MAX_DESCRIPTORS];
#ifdef USE_KQUEUE
EngineHandle = kqueue();
#endif
+#ifdef USE_SELECT
+ EngineHandle = 0;
+#endif
+ if (EngineHandle == -1)
+ {
+ log(SPARSE,"ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features.");
+ 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.");
+ Exit(0);
+ }
CurrentSetSize = 0;
}
return true;
}
+bool SocketEngine::HasFd(int fd)
+{
+ if ((fd < 0) || (fd > MAX_DESCRIPTORS))
+ return false;
+ return (ref[fd] != 0);
+}
+
bool SocketEngine::DelFd(int fd)
{
log(DEBUG,"SocketEngine::DelFd(%d)",fd);