Main Page Class Hierarchy Compound List File List Compound Members File Members

# socket_exception.h

Go to the documentation of this file.

    00001 //---------------------------------------------------------------------------
    00002 #ifndef socket_exceptionH
    00003 #define socket_exceptionH
    00004 //---------------------------------------------------------------------------
    00005 #include <worm_socket.h>
    00006 #include <worm_exceptions.h>
    00007
    00008
    00009 //---------------------------------------------------------------------------
    00010
    00011 class worm_socket_exception : public worm_exception
    00012 {
    00013 protected:
    00014    WS_FUNCTION_ID FunctionId;
    00015    int ErrorCode;
    00016    int CloseType;
    00017 public:
    00018    worm_socket_exception( WS_FUNCTION_ID p_functionid
    00019                         , int p_errorcode
    00020                         , const char * p_what
    00021                         , int p_closesocket = 0
    00022                         ) : worm_exception( p_what )
    00023    {
    00024       FunctionId = p_functionid;
    00025       ErrorCode = p_errorcode;
    00026       CloseType = p_closesocket;
    00027    }
    00028    worm_socket_exception( WS_FUNCTION_ID p_functionid
    00029                         , int p_errorcode
    00030                         , std::string p_what
    00031                         , int p_closesocket = 0
    00032                         ) : worm_exception( p_what )
    00033    {
    00034       FunctionId = p_functionid;
    00035       ErrorCode = p_errorcode;
    00036       CloseType = p_closesocket;
    00037    }
    00038
    00039    static const char * DecodeError( WS_FUNCTION_ID p_functionid, int p_errcode );
    00040
    00041    const char * DecodeError() const;
    00042    const WS_FUNCTION_ID GetFunctionId() { return FunctionId; }
    00043    const int GetErrorCode() { return ErrorCode; }
    00044    const int SocketCloseType() { return CloseType; }
    00045 };
    00046
    00047
    00048 #endif
    00049