Handle error in lan connection.

This commit is contained in:
hiker 2016-02-25 09:49:45 +11:00
parent 9d546d4980
commit 03f4339cee

View File

@ -377,9 +377,14 @@ void ConnectToServer::handleSameLAN()
const int LEN=256;
char buffer[LEN];
int len = host->receiveRawPacket(buffer, LEN, &sender, 2000);
if(len<0)
{
Log::warn("ConnectToServer",
"Received invalid server information message.");
return;
}
BareNetworkString message(buffer, len
);
BareNetworkString message(buffer, len);
std::string received;
message.decodeString(0, &received);
host->startListening(); // start listening again