Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: es_sock.h
Link against: esock.lib

Class TSockAddr

TSockAddr

Support

Supported from 5.0

Description

Represents an end point address. Protocols interpret the class within the socket server to route packets and form connections. It can be used on its own or as derived by protocols. The SSockAddr class acts as an offset map for the TSockAddr class which has a family field and a port field. The family field may be used by protocols to "up-cast" the base-class to the correct derived class. The port field is provided because it is a common practice for protocols to use port equivalents in addressing.

Writing derived classes:

The two protected member functions allow further data members to be defined past the area of the base SSockAddr. In any derived constructor the length of the descriptor should be set to the length of the valid data contained in the address. Subsequent member function calls should also adjust the length if it affects valid data.

Derivation

TBuf8This is a descriptor class which provides a buffer of fixed length for containing, accessing and manipulating TUint8 data
TBufBase8Base class used in the derivation of TBuf8
TDes8Modifiable 8-bit descriptor; abstract class
TDesC8Abstract base class for 8 bit non-modifiable descriptors
TSockAddrRepresents an end point address

Defined in TSockAddr:
CmpPort(), Family(), GetUserLen(), Port(), SetFamily(), SetPort(), SetUserLen(), TSockAddr(), UserPtr()

Inherited from TBuf8:
operator=()

Inherited from TDes8:
Append(), AppendFill(), AppendFormat(), AppendFormatList(), AppendJustify(), AppendNum(), AppendNumFixedWidth(), AppendNumFixedWidthUC(), AppendNumUC(), Capitalize(), Collate(), Copy(), CopyC(), CopyCP(), CopyF(), CopyLC(), CopyUC(), Delete(), Fill(), FillZ(), Fold(), Format(), FormatList(), Insert(), Justify(), LowerCase(), MaxLength(), MaxSize(), Num(), NumFixedWidth(), NumFixedWidthUC(), NumUC(), PtrZ(), Repeat(), Replace(), SetLength(), SetMax(), Swap(), Trim(), TrimAll(), TrimLeft(), TrimRight(), UpperCase(), Zero(), ZeroTerminate(), operator+=(), operator=, operator[]()

Inherited from TDesC8:
Alloc(), AllocL(), AllocLC(), Compare(), CompareC(), CompareF(), Find(), FindC(), FindF(), Left(), Length(), Locate(), LocateF(), LocateReverse(), LocateReverseF(), Match(), MatchC(), MatchF(), Mid(), Ptr(), Right(), Size(), operator!=(), operator<(), operator<=(), operator==(), operator>(), operator>=()


Construction


TSockAddr()

TSockAddr();
TSockAddr(TUint aFamily);

Description

Constructs the address as a zero-filled or with the family member data specified.

Parameters

TUint aFamily

Address family of address object.

[Top]


Address families


Family()

TUint Family() const;

Description

Gets the address family and thereby the type of address. The family may be used to effect ‘down-casting’.

Return value

TUint

Address family.


SetFamily()

void SetFamily(TUint aFamily);

Description

Sets the address family of an address.

Parameters

TUint aFamily

Address family of address object.

[Top]


Address ports


Port()

TUint Port() const;

Description

Gets the port value.

Return value

TUint

Port value


SetPort()

void SetPort(TUint aPort);

Description

Sets the address port of an address.

Parameters

TUint aPort

New port value for address


CmpPort()

TBool CmpPort(const TSockAddr& anAddr) const;

Description

Compares ports in two addresses.

Return value

TBool

ETrue if the ports match and EFalse if they do not.

[Top]


Information after base data


GetUserLen()

TInt GetUserLen();

Description

Gets the number of bytes a derived class has set beyond theSSockAddr part of the address. This function is mainly intended for use in derived classes.

Return value

TInt

User length


SetUserLen()

Protected: void SetUserLen(TInt aLen);

Description

Sets the length of data it appends after the base class’ data.. This function is mainly intended for use in derived classes.

Parameters

TInt aLen

New length for appended data.


UserPtr()

inline TUint8* UserPtr() const;

Description

Gets an offset to place data after the base class data. This function is mainly intended for use in derived classes.

Return value

TUint8*

Pointer to derived class intended data area