Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: wapcli.h
Link against: wapstkcli.lib

Class RWSPCOConn

RWSPCOConn

Support

Supported from 6.0

Description

Connection-oriented WSP. WSP (Wireless Session Protocol) is the upper-level application layer of the WAP communications stack. The connection-orientated mode operates above the transaction layer protocol, WTP.

For error codes, see TReturnCodes, and RWAPConn::TReturnCodes.

Derivation

RSubSessionBaseClient-side handle to a sub-session
RWAPConnOperations available on connections in all stack layers
RWSPCOConnConnection-oriented WSP

Defined in RWSPCOConn:
CancelGetEvent(), Close(), Connect(), CreateTransaction(), Disconnect(), EAbort_ind_t, EBufferTooSmall, ECapabilities, EClientHeaders, EConfirmedPush_ind_t, EConnect_cnf_s, EConnected, EConnecting, EDisconReason, EDisconnect_ind_s, EDisconnected, EErrorBody, EErrorHeaders, EException_ind_e, EInit, EInvalidSession, EInvalidState, EMRUExceeded, EMethodInvoke_cnf_t, EMethodResult_ind_t, ENotSupported, EParameterError, EPush_ind_t, EQueueLen, ERedirectAddresses, ERedirectOptions, ERedirect_ind_s, EReplying, EResume_cnf_s, EResuming, EServerHeaders, ESessionClosed, ESessionNotConnected, ESuspendReason, ESuspend_ind_s, ESuspended, GetEvent(), GetNrOfEvents(), GetSessionData(), GetSessionState(), Open(), Resume(), Suspend(), TEvent, TEventType, TReturnCodes, TSessionDataType, TSessionState

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

Inherited from RWAPConn:
CancelAll(), EBadConnection, EBearerError, ECannotOpenPort, EDelete, EGet, EHead, EMoreData, EOptions, EPortAlreadyBound, EPost, EPut, ETooManyConnections, ETrace, GetBearer(), GetLocalPort(), GetRemoteAddress(), TMethod, TPort


Member functions


CancelGetEvent()

void CancelGetEvent();

Description

Cancels an asynchronous GetEvent() request.


Close()

TInt Close();

Description

Closes sub-session.

Return value

TInt

Error code

See also:


Connect()

TInt Connect(const TDesC8& aClientHeaders, CCapCodec* aCap);

Description

Starts a WSP session with the server. Initialise a connection first with Open().

Parameters

const TDesC8& aClientHeaders

Session headers communicated to the server during session establishment

CCapCodec* aCap

Proposed capabilities. If 0, the default is used.

Return value

TInt

Error code


CreateTransaction()

TInt CreateTransaction(TMethod aMethod, const TDesC& aURI, const TDesC8& aHeaders, const TDesC8& aBody, RWSPCOTrans& aTrans);

Description

Creates and executes a new method invocation transaction. The returned RWSPCOTrans is then used to manage the transaction.

Parameters

TMethod aMethod

Method type.

const TDesC& aURI

URI

const TDesC8& aHeaders

Headers. The content type must be the first header field if aBody is given. This can be empty.

const TDesC8& aBody

Data associated with the invoke. This is semantically equivalent to an HTTP entity body. If aMethod doesn't require a body, then this parameter must be empty.

RWSPCOTrans& aTrans

On return, a handle to the transaction created.

Return value

TInt

Error code


Disconnect()

TInt Disconnect();

Description

Ends a WSP session with the server. All pending transactions are aborted.

Return value

TInt

Error code


GetEvent()

TInt GetEvent(TEvent& aEvent,RWSPCOTrans& aTrans) const;

Description

Gets next session or transaction event on this session, synchronous version.

Parameters

TEvent& aEvent

On return, the event.

RWSPCOTrans& aTrans

The transaction associated with the event, if aEvent is a transaction event.

Return value

TInt

Error code


GetEvent()

void GetEvent(TEvent& aEvent,RWSPCOTrans& aTrans,TRequestStatus& aStatus) const;

Description

Gets next session or transaction event on this session, asynchronous version.

Parameters

TEvent& aEvent

On completion, the event.

RWSPCOTrans& aTrans

On completion, The transaction associated with the event, if aEvent is a transaction event. This will contain an empty transaction untill the requests completes.

TRequestStatus& aStatus

Asynchronous request status


GetNrOfEvents()

TInt GetNrOfEvents(TUint& aNrOfEvents) const;

Description

Gets the number of events pending for the session.

Parameters

TUint& aNrOfEvents

On return, the number of events

Return value

TInt

Error code


GetSessionData()

TInt GetSessionData(TDes8& aData, TSessionDataType aType) const;

Description

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

Parameters

TDes8& aData

On return, the data of the requested type

TSessionDataType aType

Type of data to get

Return value

TInt

Error code


GetSessionState()

TInt GetSessionState(TSessionState& aState) const;

Description

Gets the session state.

Parameters

TSessionState& aState

Return value

TInt

Error code


Open()

TInt Open(RWAPServ& aServer, const TDesC8& aRemoteHost, TPort aRemotePort, TPort aLocalPort, TBearer aBearer, TBool aSecureConn);

Description

Initialises a fully specified connection.

Parameters

RWAPServ& aServer

Handle to the session with the EPOC WAP server.

const TDesC8& aRemoteHost

Remote address. The format is dependent on the bearer.

TPort aRemotePort

Remote port.

TPort aLocalPort

Local port. If 0, the port is allocated automatically.

TBearer aBearer

Bearer to use

TBool aSecureConn

Always EFalse

Return value

TInt

Error code


Resume()

TInt Resume(RWSPCOConn& aBlankConn, const TDesC8& aHeaders);

Description

Resumes suspended session.

Parameters

RWSPCOConn& aBlankConn

const TDesC8& aHeaders

Session headers communicated to the server during session establishment

Return value

TInt

Error code


Suspend()

TInt Suspend();

Description

Suspends session. No incoming or outgoing activity is allowed within the session. All pending transactions of the session are aborted, and events corresponding to aborted transactions are not delivered through GetEvent().

Note: suspend and resume must be defined as part of the protocol capabilities for this session.

Return value

TInt

Error code

[Top]


Typedef TEvent

typedef TPckgBuf<TInt> TEvent;

Description

Event description. It contains a TEventType value, which can be accessed through the () operator.

See also:

[Top]


Enum TEventType

TEventType

Description

Event types.

See also:

EDisconnect_ind_s

Disconnect indication

ESuspend_ind_s

Suspend indication

EResume_cnf_s

Resume confirmation

EConnect_cnf_s

Connect confirmation

ERedirect_ind_s

Redirect indication

EMethodInvoke_cnf_t

Method Invoke confirmation

EMethodResult_ind_t

Method Result indication

EAbort_ind_t

Abort indication

EPush_ind_t

Push indication

EConfirmedPush_ind_t

Confirmed Push indication

EException_ind_e

Exception indication

[Top]


Enum TReturnCodes

TReturnCodes

Description

Error codes.

EBufferTooSmall

Given buffer is too small

EInvalidSession

Session handle is not valid

EParameterError

Given parameter is invalid

ESessionNotConnected

Session is not connected

ENotSupported

Functionality is not supported in this session

EInvalidState

Function is not applicable in this state of an object

ESessionClosed

Session has been closed

EMRUExceeded

Server MRU exceeded

[Top]


Enum TSessionDataType

TSessionDataType

Description

Session data types.

See also:

EServerHeaders

Server headers

EClientHeaders

Client headers

ECapabilities

Capabilities

ERedirectOptions

Redirect options

ERedirectAddresses

Redirect addresses

EQueueLen

Unused

EErrorHeaders

Error headers

EErrorBody

Error body

EDisconReason

Disconnection reason

ESuspendReason

Unused

[Top]


Enum TSessionState

TSessionState

Description

Session state.

See also:

EInit

State on session creation

EConnecting

State after connect request

EConnected

State after connect confirmation

ESuspended

State after suspend indication

EResuming

State after resume confirmation

EReplying

Unused

EDisconnected

State after disconnect indication