]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/listensocket.cpp
Add Module::init() for correct exception handling during hook registration
[user/henk/code/inspircd.git] / src / listensocket.cpp
index 43584eae1d28051432859136bd20206fb9f6905a..e77a585ef4d74758986e3ab47d60156c5616545c 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -31,11 +31,12 @@ ListenSocket::ListenSocket(ConfigTag* tag, const std::string& addr, int port)
        irc::sockets::satoap(bind_to, bind_addr, bind_port);
        bind_desc = irc::sockets::satouser(bind_to);
 
-       fd = irc::sockets::OpenTCPSocket(bind_addr);
+       fd = socket(bind_to.sa.sa_family, SOCK_STREAM, 0);
 
        if (this->fd > -1)
        {
-               int rv = ServerInstance->SE->Bind(this->fd, &bind_to.sa, sizeof(bind_to));
+               ServerInstance->SE->SetReuse(fd);
+               int rv = ServerInstance->SE->Bind(this->fd, bind_to);
                if (rv >= 0)
                        rv = ServerInstance->SE->Listen(this->fd, ServerInstance->Config->MaxConn);