made better error messages for machines that cannot bind to local ports

This commit is contained in:
Dave White 2004-08-28 04:26:14 +00:00
parent 780d88de83
commit d5d8ce54b8

View file

@ -207,7 +207,8 @@ connection connect(const std::string& host, int port)
TCPsocket sock = SDLNet_TCP_Open(&ip);
if(!sock) {
throw error("Could not connect to host");
throw error(hostname == NULL ? "Could not bind to port" :
"Could not connect to host");
} else {
//TODO: add code in here which sets the socket to non-blocking
}