Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: rhttpsession.h
Link against: http.lib

Class RHTTPSession

class RHTTPSession;

Description

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.

Members

Defined in RHTTPSession:
Close(), ConnectL(), ConnectionInfo(), DisconnectL(), FailSessionEvent(), FilterCollection(), GetTable(), ListAvailableProtocolsL(), OpenL(), OpenL(), OpenL(), OpenTransactionL(), RHTTPSession(), RequestSessionHeadersL(), ResponseSessionHeadersL(), SendSessionEventL(), ServerCert(), SetSessionEventCallback(), StringPool(), operator!=(), operator==()

See also:


Construction and destruction


RHTTPSession()

inline RHTTPSession();

Description

Constructor.

Post-Condition

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

[Top]


Member functions


SetSessionEventCallback()

IMPORT_C void SetSessionEventCallback(MHTTPSessionEventCallback *aSessionEventCallback);

Description

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

Parameters

MHTTPSessionEventCallback *aSessionEventCallback


SendSessionEventL()

IMPORT_C void SendSessionEventL(THTTPSessionEvent aStatus, THTTPSessionEvent::TDirection aDirection, THTTPFilterHandle aStart=THTTPFilterHandle::EClient);

Description

Send an session event

Parameters

THTTPSessionEvent aStatus

THTTPSessionEvent::TDirection aDirection

THTTPFilterHandle aStart


FailSessionEvent()

IMPORT_C void FailSessionEvent(THTTPFilterHandle aStart=THTTPFilterHandle::EClient);

Description

Fail the session event

Parameters

THTTPFilterHandle aStart


OpenL()

IMPORT_C void OpenL();

Pre-Condition

The session is closed. An active scheduler is installed.

Description

Opens the session using the default protocol HTTP/TCP. This function leaves with an apropriate code if the open failed.

Post-Condition

The session is open.


OpenL()

IMPORT_C void OpenL(const TDesC8 &aProtocol);

Pre-Condition

The session is closed. An active scheduler is installed.

Description

Opens the session using the protocol indicated by the parameter passed in. This function leaves with an apropriate code if the open failed.

Post-Condition

The session is open.

Parameters

const TDesC8 &aProtocol

The protocol required


OpenL()

IMPORT_C void OpenL(const TDesC8 &aProtocol, MHTTPFilterCreationCallback *aSessionCallback);

Pre-Condition

The session is closed. An active scheduler is installed.

Description

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.

Post-Condition

The session is open.

Parameters

const TDesC8 &aProtocol

The protocol required

MHTTPFilterCreationCallback *aSessionCallback

The pointer to the object providing the call back method


ListAvailableProtocolsL()

static IMPORT_C void ListAvailableProtocolsL(RPointerArray< HBufC8 > &aProtocolArray);

Description

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.

Parameters

RPointerArray< HBufC8 > &aProtocolArray

A pointer array to heap based descriptors. The data in this array will be deleted and filled with descriptors containing the available protocols


OpenTransactionL()

IMPORT_C RHTTPTransaction OpenTransactionL(const TUriC8 &aURI, MHTTPTransactionCallback &aCallback, RStringF aMethod=RStringF());

Pre-Condition

The session is open

Description

Creates a transaction.

Parameters

const TUriC8 &aURI

The URI that the request will be sent to.

MHTTPTransactionCallback &aCallback

A callback for all status events relating to this transaction.

RStringF aMethod

The HTTP method to use (default: GET)

Return value

RHTTPTransaction

Leave codes

KErrNoMemory

There was not enough memory.


Close()

IMPORT_C void Close();

Description

Closes the session. All transactions will be stopped and closed

Post-Condition

The session and all open transactions in it are closed.


GetTable()

static IMPORT_C const TStringTable &GetTable();

Description

Return value

const TStringTable &


StringPool()

IMPORT_C RStringPool StringPool() const;

Description

Accessor for the HTTP string pool.

Return value

RStringPool

A handle for the string pool used in HTTP.


ConnectionInfo()

IMPORT_C RHTTPConnectionInfo ConnectionInfo() const;

Description

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.

Return value

RHTTPConnectionInfo

A handle to the connection inf.


FilterCollection()

inline RHTTPFilterCollection FilterCollection() const;

Description

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

Return value

RHTTPFilterCollection


RequestSessionHeadersL()

IMPORT_C RHTTPHeaders RequestSessionHeadersL();

Description

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

Return value

RHTTPHeaders


ResponseSessionHeadersL()

IMPORT_C RHTTPHeaders ResponseSessionHeadersL();

Description

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

Return value

RHTTPHeaders


operator==()

inline TBool operator==(RHTTPSession aTrans) const;

Description

Equality operator.

Parameters

RHTTPSession aTrans

The session to compare this one to.

Return value

TBool


operator!=()

inline TBool operator!=(RHTTPSession aTrans) const;

Description

Inequality operator

Parameters

RHTTPSession aTrans

The session to compare this one to.

Return value

TBool


ServerCert()

IMPORT_C TInt ServerCert(TCertInfo &aServerCert);

Description

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

Parameters

TCertInfo &aServerCert

A client supplied object into which the certificate information will be placed.

Return value

TInt

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


ConnectL()

IMPORT_C void ConnectL();

Description

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


DisconnectL()

IMPORT_C void DisconnectL();

Description

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