Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
TSockAddr Class Reference

Represents an end point address. More...

#include <es_sock.h>

Inheritance diagram for TSockAddr:
TInetAddr TLinkAddr

Public Member Functions

IMPORT_C TSockAddr ()
 Default constructor initialises the address to be zero-filled.
 
IMPORT_C TSockAddr (TUint aFamily)
 Constructs the address with the family member data specified.
 
IMPORT_C TUint Family () const
 Gets the address family and thereby the type of address.
 
IMPORT_C void SetFamily (TUint aFamily)
 Sets the address family of an address.
 
IMPORT_C TUint Port () const
 Gets the port value.
 
IMPORT_C void SetPort (TUint aPort)
 Sets the address port of an address.
 
IMPORT_C TBool CmpPort (const TSockAddr &anAddr) const
 Compare two ports.
 
IMPORT_C TInt GetUserLen ()
 Gets the number of bytes a derived class has set beyond the SSockAddr part of the address.
 

Protected Member Functions

IMPORT_C void SetUserLen (TInt aLen)
 Sets the length of data it appends after the base class' data.
 
TUint8 * UserPtr () const
 Gets an offset to place data after the base class data.
 

Detailed 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.

API status
Published to all clients. Released API.

Definition at line 236 of file es_sock.h.

Constructor & Destructor Documentation

◆ TSockAddr() [1/2]

IMPORT_C TSockAddr::TSockAddr ( )

Default constructor initialises the address to be zero-filled.

(generated from Symbian Developer Library)

◆ TSockAddr() [2/2]

IMPORT_C TSockAddr::TSockAddr ( TUint  aFamily)

Constructs the address with the family member data specified.

Parameters
aFamilyAddress family Id.

(generated from Symbian Developer Library)

Member Function Documentation

◆ CmpPort()

IMPORT_C TBool TSockAddr::CmpPort ( const TSockAddr &  anAddr) const

Compare two ports.

Compares ports in two addresses

(generated from Symbian Developer Library)

◆ Family()

IMPORT_C TUint TSockAddr::Family ( ) const

Gets the address family and thereby the type of address.

The family may be used to effect 'down-casting'.

(generated from Symbian Developer Library)

◆ GetUserLen()

IMPORT_C TInt TSockAddr::GetUserLen ( )

Gets the number of bytes a derived class has set beyond the SSockAddr part of the address.

This function is mainly intended for use in derived classes.

(generated from Symbian Developer Library)

◆ Port()

IMPORT_C TUint TSockAddr::Port ( ) const

Gets the port value.

(generated from Symbian Developer Library)

◆ SetFamily()

IMPORT_C void TSockAddr::SetFamily ( TUint  aFamily)

Sets the address family of an address.

Parameters
aFamilyAddress family Id.

(generated from Symbian Developer Library)

◆ SetPort()

IMPORT_C void TSockAddr::SetPort ( TUint  aPort)

Sets the address port of an address.

Parameters
aPortNew port value for address

(generated from Symbian Developer Library)

◆ SetUserLen()

IMPORT_C void TSockAddr::SetUserLen ( TInt  aLen)
protected

Sets the length of data it appends after the base class' data.

This function is mainly intended for use in derived classes.

Parameters
aLenNew length for appended data.

(generated from Symbian Developer Library)

◆ UserPtr()

TUint8 * TSockAddr::UserPtr ( ) const
inlineprotected

Gets an offset to place data after the base class data.

This function is mainly intended for use in derived classes.

(generated from Symbian Developer Library)


The documentation for this class was generated from the following files: