class RSocketServ : public RCommsSession |
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.
This class is not intended for user derivation.
Public Member Functions | |
---|---|
RSocketServ() | |
IMPORT_C void | ClearExclusiveMode() |
IMPORT_C TInt | Connect(TUint) |
IMPORT_C TInt | Connect(const TSessionPref &, TUint) |
IMPORT_C TInt | FindProtocol(const TProtocolName &, TProtocolDesc &) |
IMPORT_C TInt | GetProtocolInfo(TUint, TProtocolDesc &) |
IMPORT_C TInt | InstallExtension(const TDesC &, const TDesC &) |
IMPORT_C TInt | NumProtocols(TUint &) |
IMPORT_C void | SetExclusiveMode(TRequestStatus &) |
IMPORT_C void | StartProtocol(TUint, TUint, TUint, TRequestStatus &) |
IMPORT_C void | StopProtocol(TUint, TUint, TUint, TRequestStatus &) |
IMPORT_C TVersion | Version() |
IMPORT_C TBool | __DbgCheckFailNext() |
IMPORT_C TInt | __DbgCheckHeap(TInt) |
IMPORT_C TInt | __DbgCheckMbuf(TInt) |
IMPORT_C TInt | __DbgControl(const ESockDebug::TControlMsg &) |
IMPORT_C TInt | __DbgFailNext(TInt) |
IMPORT_C TInt | __DbgFailNextMbuf(TInt) |
IMPORT_C TInt | __DbgMarkEnd(TInt) |
IMPORT_C TInt | __DbgMarkHeap() |
IMPORT_C TInt | __DbgMbufFreeSpace() |
IMPORT_C TInt | __DbgMbufTotalSpace() |
IMPORT_C TInt | __DbgSetMbufPoolLimit(TInt) |
Inherited Enumerations | |
---|---|
RHandleBase:TAttributes | |
RSessionBase:TAttachMode |
Inherited Attributes | |
---|---|
RHandleBase::iHandle |
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 | 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.
IMPORT_C TInt | 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.
const TSessionPref & aPref | |
TUint aMessageSlots = (TUint)-1 |
IMPORT_C TInt | FindProtocol | ( | const TProtocolName & | aName, |
TProtocolDesc & | aProtocol | |||
) |
Gets information about a specific protocol, identified by it's name.
There is no wildcard support.
const TProtocolName & aName | Typed descriptor which identifies a protocol name. |
TProtocolDesc & aProtocol | A protocol description type to hold protocol information. |
IMPORT_C TInt | GetProtocolInfo | ( | TUint | anIndex, |
TProtocolDesc & | aProtocol | |||
) |
Gets information about a specific protocol.
TUint anIndex | Index of required protocol description. |
TProtocolDesc & aProtocol | A protocol description type to hold protocol information. |
IMPORT_C TInt | 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.
IMPORT_C TInt | 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().
TUint & aCount | The number of protocols is returned in aCount |
IMPORT_C void | 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.
TRequestStatus & aStatus | On completion, will contain a system-wide error codes |
IMPORT_C void | 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.
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. |
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
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 |
IMPORT_C TInt | __DbgCheckHeap | ( | TInt | aCount | ) |
Set a heap mark in the socket server
TInt aCount |
IMPORT_C TInt | __DbgCheckMbuf | ( | TInt | asize | ) |
Set the Mbuf pool limit
TInt asize |
IMPORT_C TInt | __DbgControl | ( | const ESockDebug::TControlMsg & | aRequestMsg | ) |
General purpose control message for esock debug, self dispatching messages to be thrown over it
const ESockDebug::TControlMsg & aRequestMsg |
IMPORT_C TInt | __DbgFailNext | ( | TInt | aCount | ) |
Set a heap mark in the socket server
TInt aCount |
IMPORT_C TInt | __DbgFailNextMbuf | ( | TInt | aCount | ) |
Set a Mbuf mark in the socket server
TInt aCount |
IMPORT_C TInt | __DbgMarkEnd | ( | TInt | aCount | ) |
Set a heap mark in the socket server
TInt aCount |
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 | __DbgSetMbufPoolLimit | ( | TInt | asize | ) |
Set the Mbuf pool limit
TInt asize |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.