Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <ES_SOCK.H>
Link against: esock.lib

Class RSocketServ

class RSocketServ : public RSessionBase;

Description

Provides the RSocketServ::Connect(TUint) function to create an IPC communication channel to the socket server. To close the channel RHandleBase provides a RHandleBase::Close() function.

The prime use for instances of RSocketServ is to establish subsession communications for RSocket, RHostResolver, RNetDatabase and RConnection. Any of the resources which are open using the session are automatically closed when the session is terminated, however it is more appropriate to issue a RHandleBase::Close() on each subsession object before closing the session.

The following operations are also provided:

RSocketServ::NumProtocols(TUint &) - enumerates the number of protocols of which the socket server is currently aware.

RSocketServ::GetProtocolInfo(TUint,TProtocolDesc &)/FindProtocol() - return information about a specific protocol.

RSocketServ::StartProtocol(TUint,TUint,TUint,TRequestStatus &) - loads a protocol asynchronously.

Note: This class is not intended for user derivation.

Derivation

Members

Defined in RSocketServ:

Inherited from RHandleBase:

Inherited from RSessionBase:

Related Topics


Construction and destruction


RSocketServ()

IMPORT_C RSocketServ();

Description

Default Constructor

[Top]


Member functions


Connect(TUint)

IMPORT_C TInt Connect(TUint aMessageSlots=KESockDefaultMessageSlots);

Description

Opens a session to the socket server.

The number of message slots indicates how many asychronous operations are allowed to be uncompleted at any one time by the combined resources opened on the session. The result of having too few slots is not fatal. However, operations may return KErrServerBusy indicating that no message slot was available after a small time trying.

RHandleBase::Close() should be called once the session is no longer required. All resources which are opened using the session will be automatically closed when the session terminates.

When the last session which has open resources for a protocol is closed a protocol module will be unloaded automatically by the socket server.

Parameters

TUint aMessageSlots

The number of message slots required. If not specified, 8.

Return value

TInt

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


Connect(const TSessionPref &,TUint)

IMPORT_C TInt Connect(const TSessionPref &aPref, TUint aMessageSlots=KESockDefaultMessageSlots);

Description

Opens a session to the socket server.

The session prefs provides a hint to the server of which protocol the client intend to use. This might result in better performance for the connection.

The number of message slots indicates how many asychronous operations are allowed to be uncompleted at any one time by the combined resources opened on the session. The result of having too few slots is not fatal. However, operations may return KErrServerBusy indicating that no message slot was available after a small time trying.

RHandleBase::Close() should be called once the session is no longer required. All resources which are opened using the session will be automatically closed when the session terminates.

When the last session which has open resources for a protocol is closed a protocol module will be unloaded automatically by the socket server.

Parameters

const TSessionPref &aPref

TUint aMessageSlots

The number of message slots required. If not specified, 8.

Return value

TInt

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


Version()const

IMPORT_C TVersion Version() const;

Description

Gets the version number of this client.

Return value

TVersion

Client side version number


NumProtocols(TUint &)

IMPORT_C TInt NumProtocols(TUint &aCount);

Description

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

The count returned can be used in conjunction with RSocketServ::GetProtocolInfo(TUint,TProtocolDesc &).

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(TUint,TProtocolDesc &)

IMPORT_C TInt GetProtocolInfo(TUint anIndex, TProtocolDesc &aProtocol);

Description

Gets information about a specific protocol.

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(const TProtocolName &,TProtocolDesc &)

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

Description

Gets information about a specific protocol, identified by it's name.

There is no wildcard support.

Parameters

const TBuf &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.


StartProtocol(TUint,TUint,TUint,TRequestStatus &)

Capability: NetworkControl Protocol starting is a critical operation in the comms process and must be restricted

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

Description

Loads a specified protocol asynchronously.

The protocol is 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 (e.g. IrCOMM). 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 anAddrFamily

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.


StopProtocol(TUint,TUint,TUint,TRequestStatus &)

Capability: NetworkControl Protocol stopping is a critical operation in the comms process and must be restricted

IMPORT_C void StopProtocol(TUint anAddrFamily, TUint aSockType, TUint aProtocol, TRequestStatus &aStatus);

Description

Unload a protocol asynchronously - note it will fail if there are any resources open

Parameters

TUint anAddrFamily

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 a system-wide error codes


InstallExtension(const TDesC &,const TDesC &)

Interface status: deprecated Because it always return KErrNotSupported thus useless
Capability: NetworkControl Loading extensions to

IMPORT_C TInt InstallExtension(const TDesC &aDllName, const TDesC &aArgs=TPtrC());

Description

Install an Esock Extension. PLEASE NOTE: This API is currently unsupported, calling it will always return KErrNotSupported.

Parameters

const TDesC16 &aDllName

DllName for Esock Extension

const TDesC16 &aArgs

argument for Esock Extension

Return value

TInt

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


SetExclusiveMode(TRequestStatus &)

Capability: NetworkControl Restricting

IMPORT_C void SetExclusiveMode(TRequestStatus &aStatus);

Description

Set this session as the socket server exclusive session. PLEASE NOTE: This API is currently unsupported, calling it will always return KErrNone but without actually doing anything.

Parameters

TRequestStatus &aStatus

On completion, will contain a system-wide error codes


ClearExclusiveMode()

IMPORT_C void ClearExclusiveMode();

Description

Clear exclusive mode for this session PLEASE NOTE: This API is currently unsupported, calling it will always return KErrNone but without actually doing anything.


__DbgMarkHeap()

IMPORT_C TInt __DbgMarkHeap();

Description

Set a heap mark in the socket server

Return value

TInt


__DbgCheckHeap(TInt)

IMPORT_C TInt __DbgCheckHeap(TInt aCount);

Description

Set a heap mark in the socket server

Parameters

TInt aCount

Return value

TInt


__DbgMarkEnd(TInt)

IMPORT_C TInt __DbgMarkEnd(TInt aCount);

Description

Set a heap mark in the socket server

Parameters

TInt aCount

Return value

TInt


__DbgFailNext(TInt)

IMPORT_C TInt __DbgFailNext(TInt aCount);

Description

Set a heap mark in the socket server

Parameters

TInt aCount

Return value

TInt


__DbgFailNextMbuf(TInt)

IMPORT_C TInt __DbgFailNextMbuf(TInt aCount);

Description

Set a Mbuf mark in the socket server

Parameters

TInt aCount

Return value

TInt


__DbgSetMbufPoolLimit(TInt)

IMPORT_C TInt __DbgSetMbufPoolLimit(TInt asize);

Description

Set the Mbuf pool limit

Parameters

TInt asize

Return value

TInt


__DbgCheckMbuf(TInt)

IMPORT_C TInt __DbgCheckMbuf(TInt asize);

Description

Set the Mbuf pool limit

Parameters

TInt asize

Return value

TInt


__DbgMbufFreeSpace()

IMPORT_C TInt __DbgMbufFreeSpace();

Description

Get the amount of free space in the MBuf manager

Return value

TInt


__DbgMbufTotalSpace()

IMPORT_C TInt __DbgMbufTotalSpace();

Description

Get the amount of free space in the MBuf manager

Return value

TInt