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

Provides the Connect() function to create an IPC communication channel to the socket server. More...

#include <es_sock.h>

Inheritance diagram for RSocketServ:

Public Member Functions

IMPORT_C RSocketServ ()
 Default Constructor.
 
IMPORT_C TInt Connect (TUint aMessageSlots=(TUint) -1)
 Opens a session to the socket server.
 
IMPORT_C TInt Connect (const TSessionPref &aPref, TUint aMessageSlots=(TUint) -1)
 Opens a session to the socket server.
 
IMPORT_C TVersion Version () const
 Gets the version number of this client.
 
IMPORT_C TInt NumProtocols (TUint &aCount)
 Gets the number of protocols the socket server is currently aware of.
 
IMPORT_C TInt GetProtocolInfo (TUint anIndex, TProtocolDesc &aProtocol)
 Gets information about a specific protocol.
 
IMPORT_C TInt FindProtocol (const TProtocolName &aName, TProtocolDesc &aProtocol)
 Gets information about a specific protocol, identified by it's name.
 
IMPORT_C void StartProtocol (TUint anAddrFamily, TUint aSockType, TUint aProtocol, TRequestStatus &aStatus)
 Loads a specified protocol asynchronously.
 
IMPORT_C void StopProtocol (TUint anAddrFamily, TUint aSockType, TUint aProtocol, TRequestStatus &aStatus)
 Unload a protocol asynchronously - note it will fail if there are any resources open.
 
IMPORT_C TInt InstallExtension (const TDesC &aDllName, const TDesC &aArgs=TPtrC())
 Install an Esock Extension.
 
IMPORT_C void SetExclusiveMode (TRequestStatus &aStatus)
 Set this session as the socket server exclusive session.
 
IMPORT_C void ClearExclusiveMode ()
 Clear exclusive mode for this session PLEASE NOTE: This API is currently unsupported, calling it will always return KErrNone but without actually doing anything.
 
IMPORT_C TInt __DbgMarkHeap ()
 Set a heap mark in the socket server.
 
IMPORT_C TInt __DbgCheckHeap (TInt aCount)
 Set a heap mark in the socket server.
 
IMPORT_C TInt __DbgMarkEnd (TInt aCount)
 Set a heap mark in the socket server.
 
IMPORT_C TInt __DbgFailNext (TInt aCount)
 Set a heap mark in the socket server.
 
IMPORT_C TBool __DbgCheckFailNext () const
 Empty release implementation.
 
IMPORT_C TInt __DbgFailNextMbuf (TInt aCount)
 Set a Mbuf mark in the socket server.
 
IMPORT_C TInt __DbgSetMbufPoolLimit (TInt asize)
 Set the Mbuf pool limit.
 
IMPORT_C TInt __DbgCheckMbuf (TInt asize)
 Set the Mbuf pool limit.
 
IMPORT_C TInt __DbgMbufFreeSpace ()
 Get the amount of free space in the MBuf manager.
 
IMPORT_C TInt __DbgMbufTotalSpace ()
 Get the amount of free space in the MBuf manager.
 
IMPORT_C TInt __DbgControl (const ESockDebug::TControlMsg &aRequestMsg)
 General purpose control message for esock debug, self dispatching messages to be thrown over it.
 

Detailed Description

Provides the Connect() 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 Close() on each subsession object before closing the session.

The following operations are also provided:

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

GetProtocolInfo()/FindProtocol() - return information about a specific protocol.

StartProtocol() - loads a protocol asynchronously.

Note
This class is not intended for user derivation.
API status
Published to all clients. Released API.

Definition at line 774 of file es_sock.h.

Constructor & Destructor Documentation

◆ RSocketServ()

IMPORT_C RSocketServ::RSocketServ ( )

Default Constructor.

(generated from Symbian Developer Library)

Member Function Documentation

◆ __DbgCheckFailNext()

IMPORT_C TBool RSocketServ::__DbgCheckFailNext ( ) const

Empty release implementation.

(generated from Symbian Developer Library)

◆ __DbgCheckHeap()

IMPORT_C TInt RSocketServ::__DbgCheckHeap ( TInt  aCount)

Set a heap mark in the socket server.

(generated from Symbian Developer Library)

◆ __DbgCheckMbuf()

IMPORT_C TInt RSocketServ::__DbgCheckMbuf ( TInt  asize)

Set the Mbuf pool limit.

(generated from Symbian Developer Library)

◆ __DbgControl()

IMPORT_C TInt RSocketServ::__DbgControl ( const ESockDebug::TControlMsg &  aRequestMsg)

General purpose control message for esock debug, self dispatching messages to be thrown over it.

(generated from Symbian Developer Library)

◆ __DbgFailNext()

IMPORT_C TInt RSocketServ::__DbgFailNext ( TInt  aCount)

Set a heap mark in the socket server.

(generated from Symbian Developer Library)

◆ __DbgFailNextMbuf()

IMPORT_C TInt RSocketServ::__DbgFailNextMbuf ( TInt  aCount)

Set a Mbuf mark in the socket server.

(generated from Symbian Developer Library)

◆ __DbgMarkEnd()

IMPORT_C TInt RSocketServ::__DbgMarkEnd ( TInt  aCount)

Set a heap mark in the socket server.

(generated from Symbian Developer Library)

◆ __DbgMarkHeap()

IMPORT_C TInt RSocketServ::__DbgMarkHeap ( )

Set a heap mark in the socket server.

(generated from Symbian Developer Library)

◆ __DbgMbufFreeSpace()

IMPORT_C TInt RSocketServ::__DbgMbufFreeSpace ( )

Get the amount of free space in the MBuf manager.

(generated from Symbian Developer Library)

◆ __DbgMbufTotalSpace()

IMPORT_C TInt RSocketServ::__DbgMbufTotalSpace ( )

Get the amount of free space in the MBuf manager.

(generated from Symbian Developer Library)

◆ __DbgSetMbufPoolLimit()

IMPORT_C TInt RSocketServ::__DbgSetMbufPoolLimit ( TInt  asize)

Set the Mbuf pool limit.

(generated from Symbian Developer Library)

◆ ClearExclusiveMode()

IMPORT_C void RSocketServ::ClearExclusiveMode ( )

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

(generated from Symbian Developer Library)

◆ Connect() [1/2]

IMPORT_C TInt RSocketServ::Connect ( const TSessionPref &  aPref,
TUint  aMessageSlots = (TUint) -1 
)

Opens a session to the socket server.

By providing session prefs the client states what services they require of the server. This allows the server to configure the client connection in an optimal manner. Such a configuration may not support all normal abilities of a session. For example a connection opened specifying KAfInet for the address family will be able to create TCP sockets but might not be able to create SMS sockets.

Each outstanding asynchronous request made upon the session (typically via a subsession such as RSocket) requires a message slot. If there is no free slot the request is immediately completed with KErrServerBusy. If a client specifies a fixed number of slots then they form an inelastic pool exclusive to the session. Alternatively a client can specify -1 to use the global free message pool, which can grow upon demand but has poorer time bounds and can in principle fail any request. For most clients the global pool will be appropriate since it removes the need to accurately determine the worst case size.

Note that in previous releases the default value was KESockDefaultMessageSlots (8).

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.

(generated from Symbian Developer Library)

◆ Connect() [2/2]

IMPORT_C TInt RSocketServ::Connect ( TUint  aMessageSlots = (TUint) -1)

Opens a session to the socket server.

Each outstanding asynchronous request made upon the session (typically via a subsession such as RSocket) requires a message slot. If there is no free slot the request is immediately completed with KErrServerBusy. If a client specifies a fixed number of slots then they form an inelastic pool exclusive to the session. Alternatively a client can specify -1 to use the global free message pool, which can grow upon demand but has poorer time bounds and can in principle fail any request. For most clients the global pool will be appropriate since it removes the need to accurately determine the worst case size.

Note that in previous releases the default value was KESockDefaultMessageSlots (8).

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
aMessageSlotsThe number of message slots required. If not specified then -1 to use the global pool of free messages.

(generated from Symbian Developer Library)

◆ FindProtocol()

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

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

There is no wildcard support.

Parameters
aNameTyped descriptor which identifies a protocol name.
aProtocolA protocol description type to hold protocol information.

(generated from Symbian Developer Library)

◆ GetProtocolInfo()

IMPORT_C TInt RSocketServ::GetProtocolInfo ( TUint  anIndex,
TProtocolDesc &  aProtocol 
)

Gets information about a specific protocol.

Parameters
anIndexIndex of required protocol description.
aProtocolA protocol description type to hold protocol information.

(generated from Symbian Developer Library)

◆ InstallExtension()

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

Install an Esock Extension.

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

Parameters
aDllNameDllName for Esock Extension
aArgsargument for Esock Extension
capability
NetworkControl Loading extensions to Esock will be behavioural changing and must be restricted to privileged apps

(generated from Symbian Developer Library)

◆ NumProtocols()

IMPORT_C TInt RSocketServ::NumProtocols ( TUint &  aCount)

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

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

Parameters
aCountThe number of protocols is returned in aCount

(generated from Symbian Developer Library)

◆ SetExclusiveMode()

IMPORT_C void RSocketServ::SetExclusiveMode ( TRequestStatus &  aStatus)

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
aStatusOn completion, will contain a system-wide error codes
capability
NetworkControl Restricting Esock to one session is very dangerous and must be highly restricted

(generated from Symbian Developer Library)

◆ StartProtocol()

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

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
anAddrFamilyInteger which identifies a protocol suite.
aSockTypeInteger which identifies a type of socket.
aProtocolInteger which identifies a specific protocol in a family.
aStatusOn completion will contain an error code: see the system-wide error codes.
capability
NetworkControl Protocol starting is a critical operation in the comms process and must be restricted

(generated from Symbian Developer Library)

◆ StopProtocol()

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

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

Parameters
anAddrFamilyInteger which identifies a protocol suite
aSockTypeInteger which identifies a type of socket
aProtocolInteger which identifies a specific protocol in a family
aStatusOn completion, will contain a system-wide error codes
capability
NetworkControl Protocol stopping is a critical operation in the comms process and must be restricted

(generated from Symbian Developer Library)

◆ Version()

IMPORT_C TVersion RSocketServ::Version ( ) const

Gets the version number of this client.

(generated from Symbian Developer Library)


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