CBS_SocketException Class Reference

An Exception class to handle socket exceptions. More...

Inheritance diagram for CBS_SocketException:

Inheritance graph
[legend]
Collaboration diagram for CBS_SocketException:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CBS_SocketException (LPCSTR lpReason, LPCSTR lpFileName, UINT nLine)
virtual void FreeResources (BOOL bFromDestructor=FALSE)
virtual DWORD GetErrorMessage (LPTSTR lpMessage, DWORD dwBufLen)
virtual CBS_Trace::BS_TRACE_MODE GetTraceOutput ()
virtual BOOL IsContinuable ()
void SetContinuable (BOOL bContinuable)
virtual ~CBS_SocketException ()

Protected Attributes

BOOL m_bContinuable
 A member indicating if the exception is continuable or not.
LPVOID m_lpSocketExceptionData
 Private member for internal use.

Detailed Description

An Exception class to handle socket exceptions.

Author:
Dror Otmi
Date:
12.07.2003
Version:
V 1.0 Initial version This class should be thrown when a socket error occurs. As an input it expect an application short description and as an output it will append to that string also the formatted system error.


Constructor & Destructor Documentation

CBS_SocketException::CBS_SocketException LPCSTR  lpReason,
LPCSTR  lpFileName,
UINT  nLine
 

Constructor. The application should use the macro THROW_ExSocket( reason ) when it throws a socket exception.

Parameters:
lpReason The reason that cause the exception.
lpFileName The file in which the exception was thrown.
nLine The line in lpFileName.

CBS_SocketException::~CBS_SocketException  )  [virtual]
 

Destructor.


Member Function Documentation

void CBS_SocketException::FreeResources BOOL  bFromDestructor = FALSE  )  [virtual]
 

Frees the resources allocated by the current object.

Parameters:
bFromDestructor FALSE by default, the application should never call this function with this argument set to TRUE.
Returns:
Nothing.

Reimplemented from CBS_Exception.

DWORD CBS_SocketException::GetErrorMessage LPTSTR  lpMessage,
DWORD  dwBufLen
[virtual]
 

Formats a string that describes the exception associated with the current object. The formatted string is built from the reason (passed to the constructor) and the system socket error string. For example throwing the macro THROW_ExSocket( "Could not send the data" ) from C:\MyTestFile.cpp at line 455 will format the following string:
"Bitspot Socket Exception Handler caught the following exception: Could not send the data (error nbr 10057, cause: Socket is not connected.)
C:\MyTestFile.cpp (455) :"

Parameters:
lpMessage A buffer into which the formatted message will be copied.
dwBufLen The length in bytes of lpMessage.
Returns:
The number of bytes needed for the whole message. If dwBufLen is smaller then the number of bytes needed, nothing is copied to lpMessage.

Reimplemented from CBS_Exception.

CBS_Trace::BS_TRACE_MODE CBS_SocketException::GetTraceOutput  )  [virtual]
 

See return.

Returns:
The trace error level CBS_Trace::BS_REPORT_BS_EXCEPTION_INFO.

Reimplemented from CBS_Exception.

BOOL CBS_SocketException::IsContinuable  )  [virtual]
 

See return.

Returns:
TRUE if the exception is Continuable.

Reimplemented from CBS_Exception.

void CBS_SocketException::SetContinuable BOOL  bContinuable  ) 
 

Sets the continuable flag to the exception object.

Parameters:
bContinuable TRUE if continuable (the default) and FALSE if not.
Returns:
Nothing.
Bitspot AG


Bitspot AG
Rietlistrasse 1
CH-6345 Neuheim

Bitspot AG Logo

Phone:

+41 41 755 11 22

Fax:

+41 41 755 11 31

e-mail:

mail@bitspot.com

Web:

www.bitspot.com