fix pingpong test.

This commit is contained in:
caozhiyi
2021-06-06 22:11:15 +08:00
parent 7be2099b0e
commit ea178ce6a2
3 changed files with 16 additions and 3 deletions

View File

@@ -153,7 +153,11 @@ void PosixRWSocket::OnDisConnect(Event*, uint16_t err) {
SetShutdown();
// peer disconnect or connection break.
if (_event && !(err != CEC_SUCCESS)) {
if (_event && err != CEC_SUCCESS) {
auto actions = GetEventActions();
if (actions) {
actions->DelEvent(_event);
}
OsHandle::Close(_sock);
}
}