void Socket::Bind(InetAddress const &addr) { if (bind(GetHandle(), addr.GetAddr(), addr.GetSize()) == -1) throw SocketException("Failed to bind socket", errno); }