Codechange: [Network] split CloseSocket and CloseConnection more clearly (#9261)

* Codechange: [Network] split CloseSocket and CloseConnection more clearly

- CloseSocket now closes the actual OS socket.
- CloseConnection frees up the resources to just before CloseSocket.
- dtors call CloseSocket / CloseConnection where needed.
This commit is contained in:
Patric Stout
2021-05-13 11:46:51 +02:00
committed by GitHub
parent 86741ad489
commit a403653805
17 changed files with 78 additions and 73 deletions

View File

@@ -137,17 +137,6 @@ const char *ContentInfo::GetTextfile(TextfileType type) const
return ::GetTextfile(type, GetContentInfoSubDir(this->type), tmp);
}
/**
* Close the actual socket.
*/
void NetworkContentSocketHandler::CloseSocket()
{
if (this->sock == INVALID_SOCKET) return;
closesocket(this->sock);
this->sock = INVALID_SOCKET;
}
/**
* Handle the given packet, i.e. pass it to the right
* parser receive command.