CTCPConnectionLost

Name

CTCPConnectionLost -- Exception thrown when connection to peer is lost

Synopsis


#include <CTCPConnectionLost>
       class CTCPConnectionLost
{
    
  CTCPConnectionLost( CSocket*  pSocket, const  char*  pDoing);
    
   const std::string  getHost();
       const std::string  getPort();
      virtual const const  char*  ReasonText();
  
);
  

DESCRIPTION

This class is an exception that is thrown when a CSociet object determines that it is no longer connected to its peer. This is normally detected during a data transfer operation (CSocket::Read or CSocket::Write).

METHODS

CTCPConnectionLost( CSocket* pSocket, const char* pDoing);

Constructor. pSocket is a pointer to the socket that lost connection while pDoing describes what the library was doing when it detected the connection failure/clousre.

Unfortunately the TCP/IP libraries provide no support for differentiating between a properly executed connection loss due to shtudown by the peer and improperly executed connection loss due e.g. to program failure by the peer.

const std::string getHost();

Returns the host to which the connection was lost. Note that this can either be a fully qualified domain name from DNS or a dotted IP address string.

const std::string getPort();

Returns the port string for to which the connection was lost. This can be either a service name from (e.g. from /etc/services) or a textualized service port number.

virtual const const char* ReasonText();

Provides a human readable text that describes the reason the exception was created/thrown.

SEE ALSO

CSocket