Location:
e32std.h
Link against: euser.lib
RSessionBase
Supported from 5.0
Client-side handle to a session with a server.
This is the client-side interface through which communication with the server is channelled.
Clients normally define and implement a derived class to provide a richer interface.
|
Defined in RSessionBase
:
Attach()
, CreateSession()
, EAutoAttach
, EExplicitAttach
, Send()
, SendReceive()
, SetRetry()
, Share()
, TAttachMode
Inherited from RHandleBase
:
Close()
,
Duplicate()
,
Handle()
,
SetHandle()
TInt Share(TAttachMode aAttachMode=EExplicitAttach);
Supported from 6.0
Makes the session shared among all threads in the process. A session is thread specific until this function is called.
If the session is with a server that does not support the sharing of sessions, a KERN-SVR 23 panic is raised.
If the session is already shared. the function has no effect.
Notes:
If explicit attach mode is specified, then a client thread
must call Attach()
before attempting to send a message, otherwise
it is panicked KERN-SVR 0.
|
|
TInt Attach() const;
Supported from 6.0
Explicitly attaches a thread to the session.
Calling this function ensures that the necessary Kernel resources are allocated to allow the thread to send messages.
Notes:
If a thread is required to explicitly attach to the session, then this function must be called before that thread can use the session.
A prior call to RSessionBase::Share()
must have
been made before this function is called, otherwise a KERN_SVR 0 panic is
raised.
|
protected: TInt CreateSession(const TDesC& aServer,const TVersion& aVersion);
Supported from 6.0
Creates a session with a server, specifying no message slots.
It should be called as part of session initialisation in the derived class.
Message slots are not pre-allocated for the session but are taken from a system-wide pool allowing up to 255 asynchronous messages to be outstanding. This raises a risk of failure due to lack of memory and, therefore, this mode of operation is not viable for sessions that make guarantees about the failure modes of asynchonous services.
|
|
protected: TInt CreateSession(const TDesC& aServer,const TVersion& aVersion,TInt aAsyncMessageSlots);
Supported from 6.0
Creates a session with a server.
It should be called as part of session initialisation in the derived class.
|
|
protected: TInt CreateSession(const TDesC& aServer,const TVersion& aVersion,TInt aMessageSlots,TTimeIntervalMicroSeconds32 aDelayTime=KSendDelayTime,TInt aRetryCount=KSendRetryCount);
Withdrawn in 6.0
Creates a session with a server.
It should be called as part of session initialisation in the derived class. A number of attributes governing the session are specified here.
|
|
protected: void SetRetry(TTimeIntervalMicroSeconds32 aDelayTime,TInt aRetryCount);
Withdrawn in 6.0
Changes the retry parameters used to resend a message if the server is busy.
|
protected: TInt Send(TInt aFunction,TAny* aPtr) const;
Sends a blind message to the server — no reply is expected. A message argument array is passed; this may be used to specify client addresses which the server can use to read from and write to the client address space.
|
|
protected: void SendReceive(TInt aFunction,TAny* aPtr,TRequestStatus& aStatus) const;
Sends a message to the server and waits asynchronously for the reply. An opcode specifies the service required. A message argument array is passed; this may be used to specify client addresses which the server can use to read from and write to the client address space.
|
protected: TInt SendReceive(TInt aFunction,TAny* aPtr) const;
Sends a message to the server and waits synchronously for the reply. An opcode specifies the service required. A message argument array is passed; this may be used to specify client addresses which the server can use to read from and write to the client address space.
|
|
TAttachMode
Supported from 6.0
Indicates whether threads in the process are automatically attached to the session when passed as a parameter to the Share() function.
|