RHTTPSession Class Reference

class RHTTPSession

A session handle. A session is a set of HTTP transactions using the same connection settings (e.g. proxy) and the same set of filters. Multi-homing support provided by HTTP framework enables clients to specify Connection preferences through the session property EHttpSocketConnection.

Note that RHTTPSession (and consequently the whole of HTTP) depends on the active scheduler; a scheduler must be installed when the session is opened and it must be running if a transaction is actually to do anything. RHTTPTransaction

Public Member Functions
RHTTPSession()
IMPORT_C voidClose()
IMPORT_C voidConnectL()
IMPORT_C RHTTPConnectionInfoConnectionInfo()
IMPORT_C voidDisconnectL()
IMPORT_C voidFailSessionEvent(THTTPFilterHandle)
RHTTPFilterCollection FilterCollection()
IMPORT_C const TStringTable &GetTable()
IMPORT_C MHttpDataOptimiser *HttpDataOptimiser()
IMPORT_C voidListAvailableProtocolsL(RPointerArray< HBufC8 > &)
IMPORT_C voidOpenL()
IMPORT_C voidOpenL(const TDesC8 &)
IMPORT_C voidOpenL(const TDesC8 &, MHTTPFilterCreationCallback *)
IMPORT_C RHTTPTransactionOpenTransactionL(const TUriC8 &, MHTTPTransactionCallback &, RStringF)
IMPORT_C RHTTPHeadersRequestSessionHeadersL()
IMPORT_C RHTTPHeadersResponseSessionHeadersL()
IMPORT_C voidSendSessionEventL(THTTPSessionEvent, THTTPSessionEvent::TDirection, THTTPFilterHandle)
IMPORT_C TIntServerCert(TCertInfo &)
IMPORT_C const CCertificate *ServerCert()
IMPORT_C voidSetSessionEventCallback(MHTTPSessionEventCallback *)
IMPORT_C voidSetupDefaultProxyFromCommsDatL()
IMPORT_C voidSetupHttpDataOptimiser(MHttpDataOptimiser &)
IMPORT_C RStringPoolStringPool()
TBool operator!=(RHTTPSession)
TBool operator==(RHTTPSession)
Private Attributes
CHTTPSession *iImplementation

Constructor & Destructor Documentation

RHTTPSession()

RHTTPSession()[inline]

Constructor. The session is closed. (It must be opened with OpenL)

OpenL

Member Functions Documentation

Close()

IMPORT_C voidClose()

Closes the session. All transactions will be stopped and closed The session and all open transactions in it are closed.

ConnectL()

IMPORT_C voidConnectL()

Connect this WSP session. This function does nothing when called for text-mode.

ConnectionInfo()

IMPORT_C RHTTPConnectionInfoConnectionInfo()const

Accessor for the connection info for this session, and which is used for all transactions in the session. Note that by and large, the connection info should be set up before the first transaction is created. A handle to the connection inf.

DisconnectL()

IMPORT_C voidDisconnectL()

Disconnect this WSP session. This function does nothing when called for text-mode.

FailSessionEvent(THTTPFilterHandle)

IMPORT_C voidFailSessionEvent(THTTPFilterHandleaStart = THTTPFilterHandle::EClient)

Fail the session event

Parameters

THTTPFilterHandle aStart = THTTPFilterHandle::EClient

FilterCollection()

RHTTPFilterCollection FilterCollection()const [inline]

Accessor for the filter collection. Note that the filter collection can't be edited after the first transaction has been created.

GetTable()

IMPORT_C const TStringTable &GetTable()[static]

HttpDataOptimiser()

IMPORT_C MHttpDataOptimiser *HttpDataOptimiser()

Returns the object of the MHttpDataOptimiser implementation class.

ListAvailableProtocolsL(RPointerArray< HBufC8 > &)

IMPORT_C voidListAvailableProtocolsL(RPointerArray< HBufC8 > &aProtocolArray)[static]

This is a static methods that lists all the available protocols by adding the prorocol descriptors to the descriptor array passed in. Any existing data in the descriptor array passed in is deleted. This function leaves if the descriptor array can not be updated with the appropriate array code. OpenL

Parameters

RPointerArray< HBufC8 > & aProtocolArrayA pointer array to heap based descriptors. The data in this array will be deleted and filled with descriptors containing the available protocols

OpenL()

IMPORT_C voidOpenL()

Opens the session using the default protocol HTTP/TCP. This function leaves with an apropriate code if the open failed. The session is closed. An active scheduler is installed.

The session is open.

OpenL(const TDesC8 &)

IMPORT_C voidOpenL(const TDesC8 &aProtocol)

Opens the session using the protocol indicated by the parameter passed in. This function leaves with an apropriate code if the open failed. The session is closed. An active scheduler is installed.

The session is open.

Parameters

const TDesC8 & aProtocolThe protocol required

OpenL(const TDesC8 &, MHTTPFilterCreationCallback *)

IMPORT_C voidOpenL(const TDesC8 &aProtocol,
MHTTPFilterCreationCallback *aSessionCallback
)

Opens the session using the protocol indicated by the parameter passed in. This method should be used if configuring the installed filters is required. Once construction if the session is complete the callback method passed in is called passing in a TFilterConfigurationIterator to allow the filters that are installed to be configured. This function leaves with an apropriate code if the open failed. The session is closed. An active scheduler is installed.

The session is open.

Parameters

const TDesC8 & aProtocolThe protocol required
MHTTPFilterCreationCallback * aSessionCallbackThe pointer to the object providing the call back method

OpenTransactionL(const TUriC8 &, MHTTPTransactionCallback &, RStringF)

IMPORT_C RHTTPTransactionOpenTransactionL(const TUriC8 &aURI,
MHTTPTransactionCallback &aCallback,
RStringFaMethod =  RStringF()
)

Creates a transaction. The session is open

leave

KErrNoMemory There was not enough memory.

Parameters

const TUriC8 & aURIThe URI that the request will be sent to.
MHTTPTransactionCallback & aCallbackA callback for all status events relating to this transaction.
RStringF aMethod =  RStringF()The HTTP method to use (default: GET)

RequestSessionHeadersL()

IMPORT_C RHTTPHeadersRequestSessionHeadersL()

Accessor for the session headers. These are headers that will get added to each request They only become part of the transaction headers when a transaction is submitted and they will not replace headers that already exist in the transaction request

ResponseSessionHeadersL()

IMPORT_C RHTTPHeadersResponseSessionHeadersL()

Accessor for the response session headers. These are headers that will get added to each response if the corresponding header doesn't already exist

SendSessionEventL(THTTPSessionEvent, THTTPSessionEvent::TDirection, THTTPFilterHandle)

IMPORT_C voidSendSessionEventL(THTTPSessionEventaStatus,
THTTPSessionEvent::TDirectionaDirection,
THTTPFilterHandleaStart = THTTPFilterHandle::EClient
)

Send an session event

Parameters

THTTPSessionEvent aStatus
THTTPSessionEvent::TDirection aDirection
THTTPFilterHandle aStart = THTTPFilterHandle::EClient

ServerCert(TCertInfo &)

IMPORT_C TIntServerCert(TCertInfo &aServerCert)

Obtain the server certificate information for this session. This function should only be used for WSP, for text-mode use RHttpTransaction::ServerCert. RHttpTransaction::ServerCert

KErrNone if certificate has been completed, KErrNotSupported if this function is called for text-mode.

v9.2 onwards - maintained for compatibility with v9.1 and before TCertInfo has been deprecated since v9.2. CCertificate may be used as an alternative.

Parameters

TCertInfo & aServerCertA client supplied object into which the certificate information will be placed.

ServerCert()

IMPORT_C const CCertificate *ServerCert()

Obtain the server certificate information for this session. This function should only be used for WSP. HTTP should use RHttpTransaction::ServerCert. RHttpSession::ServerCert

a CCertificate pointer to an CWTLSCertificate object. Calling code can safely cast to CWTLSCertificate if using "WSP/WSP". NULL returned if certificate information not found.

SetSessionEventCallback(MHTTPSessionEventCallback *)

IMPORT_C voidSetSessionEventCallback(MHTTPSessionEventCallback *aSessionEventCallback)

Sets the session event callback. Until it is set all incoming session events are consumed

Parameters

MHTTPSessionEventCallback * aSessionEventCallback

SetupDefaultProxyFromCommsDatL()

IMPORT_C voidSetupDefaultProxyFromCommsDatL()

Set the default Proxy for Http Session. This function reads default proxy information,if available, from CommsDat and uses it for the current Session.

SetupHttpDataOptimiser(MHttpDataOptimiser &)

IMPORT_C voidSetupHttpDataOptimiser(MHttpDataOptimiser &aHttpOptimiser)

Sets the HTTP data optimiser for the session.

Parameters

MHttpDataOptimiser & aHttpOptimiserAn object of the implementation of interface, MHttpDataOptimiser, supplied by the client.

StringPool()

IMPORT_C RStringPoolStringPool()const

Accessor for the HTTP string pool. A handle for the string pool used in HTTP.

operator!=(RHTTPSession)

TBool operator!=(RHTTPSessionaTrans)const [inline]

Inequality operator

Parameters

RHTTPSession aTransThe session to compare this one to.

operator==(RHTTPSession)

TBool operator==(RHTTPSessionaTrans)const [inline]

Equality operator.

Parameters

RHTTPSession aTransThe session to compare this one to.

Member Data Documentation

CHTTPSession * iImplementation

CHTTPSession *iImplementation[private]