]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/listensocket.cpp
Create the core_xline module
[user/henk/code/inspircd.git] / src / listensocket.cpp
index 565b6b6d87dd3749d04c96712161a74a3f3a65ef..e73a8f4cee9b9fa89df7c2e082c9a5f4182ea253 100644 (file)
@@ -78,14 +78,14 @@ ListenSocket::ListenSocket(ConfigTag* tag, const irc::sockets::sockaddrs& bind_t
        {
                int errstore = errno;
                SocketEngine::Shutdown(this, 2);
-               SocketEngine::Close(this);
+               SocketEngine::Close(this->GetFd());
                this->fd = -1;
                errno = errstore;
        }
        else
        {
                SocketEngine::NonBlocking(this->fd);
-               ServerInstance->SE->AddFd(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE);
+               SocketEngine::AddFd(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE);
 
                this->ResetIOHookProvider();
        }
@@ -95,12 +95,10 @@ ListenSocket::~ListenSocket()
 {
        if (this->GetFd() > -1)
        {
-               ServerInstance->SE->DelFd(this);
                ServerInstance->Logs->Log("SOCKET", LOG_DEBUG, "Shut down listener on fd %d", this->fd);
                SocketEngine::Shutdown(this, 2);
                if (SocketEngine::Close(this) != 0)
                        ServerInstance->Logs->Log("SOCKET", LOG_DEBUG, "Failed to cancel listener: %s", strerror(errno));
-               this->fd = -1;
        }
 }
 
@@ -137,7 +135,7 @@ void ListenSocket::AcceptInternal()
         * which for the time being is a physical impossibility (even the largest networks dont have more
         * than about 10,000 users on ONE server!)
         */
-       if (incomingSockfd >= ServerInstance->SE->GetMaxFds())
+       if (incomingSockfd >= SocketEngine::GetMaxFds())
        {
                ServerInstance->Logs->Log("SOCKET", LOG_DEBUG, "Server is full");
                SocketEngine::Shutdown(incomingSockfd, 2);