resorted functions

This commit is contained in:
Robin Müller 2021-03-21 16:29:04 +01:00
parent e3c44fd27f
commit 614d1ccb7c

View File

@ -11,13 +11,6 @@ TcpIpBase::TcpIpBase() {
} }
TcpIpBase::~TcpIpBase() {
closeSocket(serverSocket);
#ifdef _WIN32
WSACleanup();
#endif
}
ReturnValue_t TcpIpBase::initialize() { ReturnValue_t TcpIpBase::initialize() {
#ifdef _WIN32 #ifdef _WIN32
/* Initiates Winsock DLL. */ /* Initiates Winsock DLL. */
@ -36,6 +29,13 @@ ReturnValue_t TcpIpBase::initialize() {
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }
TcpIpBase::~TcpIpBase() {
closeSocket(serverSocket);
#ifdef _WIN32
WSACleanup();
#endif
}
int TcpIpBase::closeSocket(socket_t socket) { int TcpIpBase::closeSocket(socket_t socket) {
#ifdef _WIN32 #ifdef _WIN32
return closesocket(socket); return closesocket(socket);