103 svaddr.sin_port = htons (port); |
103 svaddr.sin_port = htons (port); |
104 svaddr.sin_addr.s_addr = htonl (INADDR_ANY); |
104 svaddr.sin_addr.s_addr = htonl (INADDR_ANY); |
105 |
105 |
106 if (::bind (m_socket, reinterpret_cast<sockaddr*> (&svaddr), sizeof svaddr) == -1) |
106 if (::bind (m_socket, reinterpret_cast<sockaddr*> (&svaddr), sizeof svaddr) == -1) |
107 { |
107 { |
108 m_error = String ("Couldn't bind to port ") + String::fromNumber (port); |
108 m_error = "Couldn't bind to port "s + std::to_string(port); |
109 return false; |
109 return false; |
110 } |
110 } |
111 |
111 |
112 return true; |
112 return true; |
113 } |
113 } |