]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/threadengines/threadengine_win32.cpp
Update the exemptchanops module section in modules.conf.example with missing exemptions.
[user/henk/code/inspircd.git] / src / threadengines / threadengine_win32.cpp
index 90fe60b91e8ebd58c0ae0395bc7fc9d78ead3be7..0f0d1f277442578a259c7eab14fed2063e6022cd 100644 (file)
@@ -70,6 +70,24 @@ class ThreadSignalSocket : public BufferedSocket
        }
 };
 
+static bool BindAndListen(int sockfd, int port, const char* addr)
+{
+       irc::sockets::sockaddrs servaddr;
+       if (!irc::sockets::aptosa(addr, port, servaddr))
+               return false;
+
+       if (SocketEngine::Bind(sockfd, servaddr) != 0)
+               return false;
+
+       if (SocketEngine::Listen(sockfd, ServerInstance->Config->MaxConn) != 0)
+       {
+               ServerInstance->Logs->Log("SOCKET", LOG_DEFAULT, "ERROR in listen(): %s", strerror(errno));
+               return false;
+       }
+
+       return true;
+}
+
 SocketThread::SocketThread()
 {
        int listenFD = socket(AF_INET, SOCK_STREAM, 0);
@@ -79,7 +97,7 @@ SocketThread::SocketThread()
        if (connFD == -1)
                throw CoreException("Could not create ITC pipe");
 
-       if (!ServerInstance->BindSocket(listenFD, 0, "127.0.0.1", true))
+       if (!BindAndListen(listenFD, 0, "127.0.0.1"))
                throw CoreException("Could not create ITC pipe");
        SocketEngine::NonBlocking(connFD);