Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: wapcli.h
Link against: wapstkcli.lib

Class RWSPCOTrans

RWSPCOTrans

Support

Supported from 6.0

Description

WSP connection-orientated transaction. Objects of this type are returned by RWSPCOConn::CreateTransaction(), and are used to manage an individual transaction.

For error codes, see RWSPCOConn::TReturnCodes.

Derivation

RSubSessionBaseClient-side handle to a sub-session
RWSPCOTransWSP connection-orientated transaction

Defined in RWSPCOTrans:
Abort(), Acknowledge(), EAbortReason, EAborted, EAckHeaders, EDone, EInit, EInvokeBody, EInvokeHeaders, EInvokeMethod, EInvokeUri, EPushBody, EPushHeaders, EPushing, EReplying, ERequesting, EResultBody, EResultHeaders, EResultStatus, GetData(), GetState(), RWSPCOTrans(), Release(), TAbortReason, TDataType, TState, ~RWSPCOTrans()

Inherited from RSubSessionBase:
CloseSubSession(), CreateSubSession(), Send(), SendReceive(), SubSessionHandle(), operator=()

See also:


Construction and destruction


RWSPCOTrans()

RWSPCOTrans();

Description

Default constructor.


RWSPCOTrans()

RWSPCOTrans(const RSubSessionBase& aSubSession);

Description

Constructor with initialisation from existing sub-session.

Parameters

const RSubSessionBase& aSubSession

Sub-session to initialise new subsession with


~RWSPCOTrans()

~RWSPCOTrans();

Description

Destructor.

[Top]


Member functions


Abort()

TInt Abort(TAbortReason aReason);

Description

Aborts a method invoke or push transaction. This can be used when the state of transaction is EInit or ERequesting.

Always call Release() after this function to release the transaction's resources.

Parameters

TAbortReason aReason

Reason for abort

Return value

TInt

Error code


Acknowledge()

TInt Acknowledge(const TDesC8& aAckHeaders);

Description

Acknowledges a transaction. This must be used to accept a confirmed push from the server. If the protocol option "Acknowledgement Headers" is enabled for the session, then all method requests are in EReplying state and the application must call this function to acknowledge the transaction.

Parameters

const TDesC8& aAckHeaders

Acknowledgement headers. This can be empty.

Return value

TInt

Error code


GetData()

TInt GetData(TDes8& aBuffer, TDataType aDataType) const;

Description

Gets the data associated with a transaction. If the passed buffer is smaller than the available data, then the function returns EMoreData and the remaining data can be read with successive calls.

Parameters

TDes8& aBuffer

On return, the data obtained

TDataType aDataType

Type of data to get

Return value

TInt

Error code


GetState()

TInt GetState(TState& aState) const;

Description

Gets the state the transaction is in.

Parameters

TState& aState

On return, the state

Return value

TInt

Error code


Release()

TInt Release();

Description

Releases the transaction. This must be called for completed or aborted transactions to release the associated resources.

The function succeeds only if the state of the transaction is EInit, EAborted or EDone. If the transaction is in any other state, the transaction should be first aborted.

Note that the transaction can be still alive for a short period after calling this function to be able to finish its last operations. This call causes no network traffic.

Return value

TInt

KErrNone on success, otherwise Error code

[Top]


Typedef TAbortReason

typedef TUint8 TAbortReason;

Description

Abort reason.

See also:

[Top]


Enum TDataType

TDataType

Description

Transaction data types.

See also:

EPushBody

Push body

EPushHeaders

Push headers

EResultStatus

Method result status

EResultBody

Method result body

EResultHeaders

Method result headers

EInvokeUri

Method URI

EInvokeMethod

Method types (see RWapConn::TMethod)

EInvokeHeaders

Method headers

EInvokeBody

Method body

EAckHeaders

Acknowledgement headers

EAbortReason

Abort reason

[Top]


Enum TState

TState

Description

Transaction states.

See also:

EInit

State after transaction creation

ERequesting

Transaction begun

EReplying

This state is only used if the "Acknowledgement headers" protocol capability is set for the session. In that case all transactions go from ERequesting state to EReplying state. Otherwise all transactions go from ERequesting to the EDone state directly.

EDone

Transaction complete

EAborted

State after abort indication

EPushing

State after confirmed push indication