|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
inline Socket::~Socket() { // When shutting down, be sure |
|
|
inline Socket::~Socket() { // When shutting down, be sure |
|
|
if(isOpen()) close(); // any open socket is closed. |
|
|
|
|
|
|
|
|
if(INVALID_SOCKET != Handle) { // any open socket is closed without
|
|
|
|
|
|
Network.closeSocket(Handle); // throwing any exceptions.
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
inline void Socket::close() { // When we close, |
|
|
inline void Socket::close() { // When we close, |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
inline TCPClient::~TCPClient() { // When destroying a TCPClient |
|
|
inline TCPClient::~TCPClient() { // When destroying a TCPClient |
|
|
if(isOpen()) close(); // Close when being destroyed. |
|
|
|
|
|
|
|
|
try{ if(isOpen()) close(); } catch(...) {} // silently close any open connections.
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
inline void TCPClient::open() { // We provide open() as unsupported. |
|
|
inline void TCPClient::open() { // We provide open() as unsupported. |
|
|
|
|
|
|
|
|
//// class TCPHost ///////////////////////////////////////////////////////////// |
|
|
//// class TCPHost ///////////////////////////////////////////////////////////// |
|
|
|
|
|
|
|
|
inline TCPHost::~TCPHost() { // When destroying a TCPHost |
|
|
inline TCPHost::~TCPHost() { // When destroying a TCPHost |
|
|
if(isOpen()) close(); // Close when being destroyed. |
|
|
|
|
|
|
|
|
try{ if(isOpen()) close(); } catch(...) {} // silently close any open connection. |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
inline bool TCPHost::ReadBufferIsEmpty() { // True if the ReadBuffer is empty. |
|
|
inline bool TCPHost::ReadBufferIsEmpty() { // True if the ReadBuffer is empty. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//// class TCPListener ///////////////////////////////////////////////////////// |
|
|
//// class TCPListener ///////////////////////////////////////////////////////// |
|
|
|
|
|
|
|
|
inline TCPListener::~TCPListener() { // Close when deleting. |
|
|
|
|
|
close(); |
|
|
|
|
|
|
|
|
inline TCPListener::~TCPListener() { // When destroying a TCPListener |
|
|
|
|
|
try{ close(); } catch(...) {} // silently close if not already done. |
|
|
} |
|
|
} |