Browse Source

hostAddress can be localhost, return from justConnectToServer() is maximum number of attempts is exceeded

Alexander Wilms 2 years ago
parent
commit
e1401d26c5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      client/CServerHandler.cpp

+ 2 - 2
client/CServerHandler.cpp

@@ -260,7 +260,7 @@ void CServerHandler::justConnectToServer(const std::string & addr, const ui16 po
 	boost::chrono::duration<long, boost::ratio<1, 1000>> sleepDuration{};
 	int maxConnectionAttempts;
 	
-	if(hostAddress == "127.0.0.1")
+	if(hostAddress == "127.0.0.1" || hostAddress == "localhost")
 	{
 		sleepDuration = boost::chrono::milliseconds(10);
 		maxConnectionAttempts = 100;
@@ -281,7 +281,7 @@ void CServerHandler::justConnectToServer(const std::string & addr, const ui16 po
 		if(connectionAttemptCount > maxConnectionAttempts)
 		{
 			logNetwork->error("\nExceeded maximum of %d connection attempts", maxConnectionAttempts);
-			break;
+			return;
 		}
 
 		try