diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-08-04 12:12:07 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-08-04 12:12:07 +0200 |
commit | 984db9e30147952f67be1a8f23b381e88ea79634 (patch) | |
tree | 5e1448813037503f971a8d68a928bc70985ea474 /src/socket.cpp | |
parent | e17db7c63a53cb834e2cc8d221d759bdf2c2b69b (diff) |
Remove InspIRCd::BindSocket()
Diffstat (limited to 'src/socket.cpp')
-rw-r--r-- | src/socket.cpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/socket.cpp b/src/socket.cpp index 89c9969ff..17f13bb8a 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -23,58 +23,6 @@ #include "inspircd.h" -using irc::sockets::sockaddrs; - -/** This will bind a socket to a port. It works for UDP/TCP. - * It can only bind to IP addresses, if you wish to bind to hostnames - * you should first resolve them using class 'Resolver'. - */ -bool InspIRCd::BindSocket(int sockfd, int port, const char* addr, bool dolisten) -{ - sockaddrs servaddr; - int ret; - - if ((*addr == '*' || *addr == '\0') && port == -1) - { - /* Port -1: Means UDP IPV4 port binding - Special case - * used by DNS engine. - */ - memset(&servaddr, 0, sizeof(servaddr)); - servaddr.in4.sin_family = AF_INET; - } - else if (!irc::sockets::aptosa(addr, port, servaddr)) - return false; - - ret = SocketEngine::Bind(sockfd, servaddr); - - if (ret < 0) - { - return false; - } - else - { - if (dolisten) - { - if (SocketEngine::Listen(sockfd, Config->MaxConn) == -1) - { - this->Logs->Log("SOCKET", LOG_DEFAULT, "ERROR in listen(): %s",strerror(errno)); - return false; - } - else - { - this->Logs->Log("SOCKET", LOG_DEBUG, "New socket binding for %d with listen: %s:%d", sockfd, addr, port); - SocketEngine::NonBlocking(sockfd); - return true; - } - } - else - { - this->Logs->Log("SOCKET", LOG_DEBUG, "New socket binding for %d without listen: %s:%d", sockfd, addr, port); - return true; - } - } -} - int InspIRCd::BindPorts(FailedPortList &failed_ports) { int bound = 0; |