]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/socketengine.cpp
Add amd64/linux to list of OS'es tested, but mainly CIA test :P
[user/henk/code/inspircd.git] / src / socketengine.cpp
index cec51c5d358d10075f9d7667f2e495edf8c7b2b4..bcc8e23af32e7567545a1a135dc943004af01e2d 100644 (file)
@@ -112,6 +112,13 @@ bool SocketEngine::AddFd(int fd, bool readable, char type)
        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);
@@ -201,7 +208,7 @@ int SocketEngine::Wait(int* fdlist)
                
        }
        tval.tv_sec = 0;
-       tval.tv_usec = 100L;
+       tval.tv_usec = 50L;
        sresult = select(FD_SETSIZE, &rfdset, &wfdset, NULL, &tval);
        if (sresult > 0)
        {
@@ -213,14 +220,14 @@ int SocketEngine::Wait(int* fdlist)
        }
 #endif
 #ifdef USE_KQUEUE
-       ts.tv_nsec = 10000L;
+       ts.tv_nsec = 5000L;
        ts.tv_sec = 0;
        int i = kevent(EngineHandle, NULL, 0, &ke_list[0], MAX_DESCRIPTORS, &ts);
        for (int j = 0; j < i; j++)
                fdlist[result++] = ke_list[j].ident;
 #endif
 #ifdef USE_EPOLL
-       int i = epoll_wait(EngineHandle, events, MAX_DESCRIPTORS, 100);
+       int i = epoll_wait(EngineHandle, events, MAX_DESCRIPTORS, 50);
        for (int j = 0; j < i; j++)
                fdlist[result++] = events[j].data.fd;
 #endif