| 66 | |
| 67 | |
| 68 | void cSocket::CloseSocket() |
| 69 | { |
| 70 | #ifdef _WIN32 |
| 71 | |
| 72 | closesocket(m_Socket); |
| 73 | |
| 74 | #else // _WIN32 |
| 75 | |
| 76 | if (close(m_Socket) != 0) |
| 77 | { |
| 78 | LOGWARN("Error closing socket %d (%s): %s", m_Socket, m_IPString.c_str(), GetLastErrorString().c_str()); |
| 79 | } |
| 80 | |
| 81 | #endif // else _WIN32 |
| 82 | |
| 83 | // Invalidate the socket so that this object can be re-used for another connection |
| 84 | m_Socket = INVALID_SOCKET; |
| 85 | } |
| 86 | |
| 87 | |
| 88 |
no test coverage detected