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::from_number (port); |
108 m_error = String ("Couldn't bind to port ") + String::fromNumber (port); |
109 return false; |
109 return false; |
110 } |
110 } |
111 |
111 |
112 return true; |
112 return true; |
113 } |
113 } |