Close socket when connection was closed by peer (recv returns 0)
This commit is contained in:
parent
41bf638a75
commit
e52d398f9d
1 changed files with 6 additions and 0 deletions
|
@ -210,6 +210,12 @@ public:
|
|||
SetConnectionErrorFlag();
|
||||
}
|
||||
|
||||
if(returnVal == 0) {
|
||||
//Socket closed
|
||||
std::cout << "Socket closed by peer." << std::endl;
|
||||
Close();
|
||||
}
|
||||
|
||||
return returnVal;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue