Close socket when connection was closed by peer (recv returns 0)

This commit is contained in:
Souryo 2014-07-07 23:38:29 -04:00
parent 41bf638a75
commit e52d398f9d

View file

@ -210,6 +210,12 @@ public:
SetConnectionErrorFlag();
}
if(returnVal == 0) {
//Socket closed
std::cout << "Socket closed by peer." << std::endl;
Close();
}
return returnVal;
}
};