Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: es_sock.h
Link against: esock.lib

Class RSocketServ

RSocketServ

Support

Supported from 5.0

Description

Provides the Connect() function to create an IPC communication channel to the socket server. To close the channel RHandleBase provides a Close() function. The prime use for instances of RSocketServ is to establish subsession communications for RSocket, RHostResolver and RNetDatabase. Any of the resources which are open using the session are automatically closed when the session is terminated. The following operations are also provided:

This class is not intended for user derivation

Derivation

RHandleBaseHandle to an object
RSessionBaseClient-side handle to a session with a server
RSocketServProvides the Connect() function to create an IPC communication channel to the socket server

Defined in RSocketServ:
Connect(), FindProtocol(), GetProtocolInfo(), NumProtocols(), StartProtocol(), Version()

Inherited from RHandleBase:
Close(), Duplicate(), Handle(), SetHandle()

Inherited from RSessionBase:
Attach(), CreateSession(), EAutoAttach, EExplicitAttach, Send(), SendReceive(), SetRetry(), Share(), TAttachMode


Construction and destruction


Connect()

TInt Connect(TUint aMessageSlots=KESockDefaultMessageSlots);

Description

Opens a session to the socket server.

Notes:

Parameters

TInt aMessageSlots

The number of message slots required

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.

[Top]


Information


Version()

TVersion Version() const;

Description

Gets the version of this client.

Return value

TVersion

Client side version number


NumProtocols()

TInt NumProtocols(TUint& aCount);

Description

Gets the number of protocols the socket server currently is aware of.

Note:

The count returned can be used in conjunction with GetProtocolInfo().

Parameters

TUint& aCount

The number of protocols is returned in aCount

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


GetProtocolInfo()

TInt GetProtocolInfo(TUint anIndex,TProtocolDesc& aProtocol);

Description

Gets information about all protocols.

Parameters

TUint anIndex

Index of required protocol description

TProtocolDesc& aProtocol

A protocol description type to hold protocol information

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


FindProtocol()

TInt FindProtocol(const TProtocolName& aName,TProtocolDesc& aProtocol);

Description

Gets the description of a protocol by name.

Parameters

const TProtocolName& aName

Typed descriptor which identifies a protocol name.

TProtocolDesc& aProtocol

A protocol description type to hold protocol information.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.

[Top]


Starting a protocol


StartProtocol()

void StartProtocol(TUint aFamily,TUint aSockType,TUint aProtocol,
        TRequestStatus& aStatus);

Description

Loads a protocol specified by family, socket type and protocol identifier. Note that client programs do not normally need to call this function, as loading of a protocol is done automatically by the Sockets Server when a socket of that protocol is opened. Some applications may, however, need to ensure that an open socket call will not take a significant amount of time. This function can be called by such applications to preload the protocol.

There is no way to cancel this operation once it has been called.

Parameters

TUint aFamily

Integer which identifies a protocol suite

TUint aSockType

Integer which identifies a type of socket

TUint aProtocol

Integer which identifies a specific protocol in a family

TRequestStatus& aStatus

On completion, will contain an error code, see the system-wide error codes.