#include <ES_SOCK.H>
Link against:
esock.lib
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
RSessionBase
-
Client-side handle to a session with a server.
RSocketServ
- Provides the RSocketServ::Connect(TUint) function to create an IPC communication...
Members
Defined in RSocketServ
:
ClearExclusiveMode()
Clear exclusive mode for this session PLEASE NOTE: This API is currently unsuppo...
Connect(TUint)
Opens a session to the socket server.
Connect(const TSessionPref &,TUint)
Opens a session to the socket server.
FindProtocol(const TProtocolName &,TProtocolDesc &)
Gets information about a specific protocol, identified by it's name.
GetProtocolInfo(TUint,TProtocolDesc &)
Gets information about a specific protocol.
InstallExtension(const TDesC &,const TDesC &)
Install an Esock Extension. PLEASE NOTE: This API is currently unsupported, call...
NumProtocols(TUint &)
Gets the number of protocols the socket server is currently aware of.
RSocketServ()
Default Constructor
SetExclusiveMode(TRequestStatus &)
Set this session as the socket server exclusive session. PLEASE NOTE: This API i...
StartProtocol(TUint,TUint,TUint,TRequestStatus &)
Loads a specified protocol asynchronously.
StopProtocol(TUint,TUint,TUint,TRequestStatus &)
Unload a protocol asynchronously - note it will fail if there are any resources ...
Version()const
Gets the version number of this client.
__DbgCheckHeap(TInt)
Set a heap mark in the socket server
__DbgCheckMbuf(TInt)
Set the Mbuf pool limit
__DbgFailNext(TInt)
Set a heap mark in the socket server
__DbgFailNextMbuf(TInt)
Set a Mbuf mark in the socket server
__DbgMarkEnd(TInt)
Set a heap mark in the socket server
__DbgMarkHeap()
Set a heap mark in the socket server
__DbgMbufFreeSpace()
Get the amount of free space in the MBuf manager
__DbgMbufTotalSpace()
Get the amount of free space in the MBuf manager
__DbgSetMbufPoolLimit(TInt)
Set the Mbuf pool limit
Inherited from RHandleBase
:
Inherited from RSessionBase
:
CreateSession(RServer2,const TVersion &)
Creates a session with a server, specifying no message slots.
CreateSession(RServer2,const TVersion &,TInt)
Creates a session with a server.
CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
Creates a session with a server.
CreateSession(const TDesC &,const TVersion &)
Creates a session with a server, specifying no message slots.
CreateSession(const TDesC &,const TVersion &,TInt)
Creates a session with a server.
CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
Creates a session with a server.
CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *)
EAutoAttach
EExplicitAttach
Open(RMessagePtr2,TInt,TOwnerType)
Opens a handle to a session using a handle number sent by a client to a server.
Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType)
Opens a handle to a session using a handle number sent by a client to a server, ...
Open(TInt,TOwnerType)
Opens a handle to a session using a handle number passed as an environment data ...
Open(TInt,const TSecurityPolicy &,TOwnerType)
Opens a handle to a session using a handle number passed as an environment data ...
Send(TInt)const
Issues a blind request to the server with the specified function number, but wit...
Send(TInt,const TIpcArgs &)const
Issues a blind request to the server with the specified function number, and arg...
SendReceive(TInt)const
Issues a synchronous request to the server with the specified function number, b...
SendReceive(TInt,TRequestStatus &)const
Issues an asynchronous request to the server with the specified function number,...
SendReceive(TInt,const TIpcArgs &)const
Issues a synchronous request to the server with the specified function number an...
SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
Issues an asynchronous request to the server with the specified function number ...
SetReturnedHandle(TInt)
Sets the handle-number of this handle to the specified value.
SetReturnedHandle(TInt,RHandleBase &)
SetReturnedHandle(TInt,const TSecurityPolicy &)
Sets the handle-number of this session handle to the specified value after valid...
ShareAuto()
Creates a session that can be shared by other threads in the current process.
ShareProtected()
Creates a session handle that can be be passed via IPC to another process as wel...
TAttachMode
Indicates whether or not threads in the process are automatically attached to th...
Related Topics
»
Symbian OS v9.4 »
Examples »
Multimedia Protocols example code »
RTPExample: RTP packet streaming
»
Symbian OS v9.4 »
Symbian OS guide »
Short Link Services »
Short Link Services »
Short Link Collection »
Bluetooth Profiles »
Bluetooth PAN Profile »
PAN-NAP Role Guide
Construction and destruction
IMPORT_C RSocketServ();
Description
Default Constructor
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.
|
|
IMPORT_C TVersion Version() const;
Description
Gets the version number of this client.
Return value
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
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
|
|
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.
IMPORT_C TInt __DbgMarkHeap();
Description
Set a heap mark in the socket server
Return value
IMPORT_C TInt __DbgCheckHeap(TInt aCount);
Description
Set a heap mark in the socket server
Parameters
Return value
IMPORT_C TInt __DbgMarkEnd(TInt aCount);
Description
Set a heap mark in the socket server
Parameters
Return value
IMPORT_C TInt __DbgFailNext(TInt aCount);
Description
Set a heap mark in the socket server
Parameters
Return value
IMPORT_C TInt __DbgFailNextMbuf(TInt aCount);
Description
Set a Mbuf mark in the socket server
Parameters
Return value
__DbgSetMbufPoolLimit(TInt)
IMPORT_C TInt __DbgSetMbufPoolLimit(TInt asize);
Description
Set the Mbuf pool limit
Parameters
Return value
IMPORT_C TInt __DbgCheckMbuf(TInt asize);
Description
Set the Mbuf pool limit
Parameters
Return value
IMPORT_C TInt __DbgMbufFreeSpace();
Description
Get the amount of free space in the MBuf manager
Return value
IMPORT_C TInt __DbgMbufTotalSpace();
Description
Get the amount of free space in the MBuf manager
Return value