From b46e85e5678e06ec10eea69cacf11bb57eeb1fcf Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 8 Dec 2017 10:21:05 +0100 Subject: Explicity call ::bind() --- src/TcpSocket.cpp | 2 +- src/UdpSocket.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TcpSocket.cpp b/src/TcpSocket.cpp index b233c9f..76e9c2e 100644 --- a/src/TcpSocket.cpp +++ b/src/TcpSocket.cpp @@ -66,7 +66,7 @@ TcpSocket::TcpSocket(int port, const string& name) : m_own_address.setAddress(name); m_own_address.setPort(port); - if (bind(m_sock, m_own_address.getAddress(), sizeof(sockaddr_in)) == SOCKET_ERROR) { + if (::bind(m_sock, m_own_address.getAddress(), sizeof(sockaddr_in)) == SOCKET_ERROR) { ::close(m_sock); m_sock = INVALID_SOCKET; throw std::runtime_error("Can't bind socket"); diff --git a/src/UdpSocket.cpp b/src/UdpSocket.cpp index 981d713..3d015ec 100644 --- a/src/UdpSocket.cpp +++ b/src/UdpSocket.cpp @@ -88,7 +88,7 @@ int UdpSocket::reinit(int port, const std::string& name) address.setAddress(name); address.setPort(port); - if (bind(listenSocket, address.getAddress(), sizeof(sockaddr_in)) == SOCKET_ERROR) { + if (::bind(listenSocket, address.getAddress(), sizeof(sockaddr_in)) == SOCKET_ERROR) { setInetError("Can't bind socket"); ::close(listenSocket); listenSocket = INVALID_SOCKET; -- cgit v1.2.3