Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: in_sock.h

Class TSoInetLastErr

class TSoInetLastErr;

Description

Error information for TCP/IP protocols.

An object of this class is returned packaged as a TPckgBuf<TSoInetLastErr> in the option argument of RSocket::GetOpt(), when this function is called with (KSolInetIp, KSoInetLastError). The data members of this object are updated whenever a packet carrying an ICMP message is received.

Note: This class is originally defined only for the IPv4 environment, and there is no definite way of knowing whether the fields iErrType and iErrCode contain ICMPv4 or ICMPv6 codes. A solution that will give the correct answer in most normal cases, is

    TSoInetLastErr p;
    ...
    if (p.iErrAddr.Family() == KAfInet || p.iErrAddr.IsV4Mapped())
        // assume ICMPv4 type and code
    else
        // assume ICMPv6 type and code

Alternatively, the error can be interpreted based on the member variable iStatus, if it contains one of the extended error codes. These are are common for both IPv4 and IPv6.

Members

Defined in TSoInetLastErr:
iDstAddr, iErrAddr, iErrCode, iErrType, iSrcAddr, iStatus


Member data


iStatus

TInt iStatus;

Description

The error code returned by the last ESOCK API function called.


iErrType

TInt iErrType;

Description

The value of the Type field of the last ICMP message.


iErrCode

TInt iErrCode;

Description

The value of the Code field of the last ICMP message.


iSrcAddr

TInetAddr iSrcAddr;

Description

A TInetAddr with the IP address and port set to the source address and port of the failed datagram.


iDstAddr

TInetAddr iDstAddr;

Description

A TInetAddr with the IP address and port set to the destination address and port of the failed datagram.


iErrAddr

TInetAddr iErrAddr;

Description

A TInetAddr with the IP address set to the address of the host that generated the error.