Symbian
 Developer Library

DEVELOPER LIBRARY

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



Location: http\rhttpsession.h
Link against: http.lib

Class RHTTPSession

class RHTTPSession

Support

Supported from 7.0

Description

A transport framework session handle.

A session is a set of transactions using the same connection settings (e.g. proxy) and the same set of filters.

Note that RHTTPSession depends on the active scheduler; a scheduler must be installed when the session is opened, and it must be running for transactions to be processed.

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

See also:


Construction and destruction


RHTTPSession()

inline RHTTPSession();

Description

Constructor.

[Top]


Member Functions


SetSessionEventCallback()

void SetSessionEventCallback(MHTTPSessionEventCallback* aSessionEventCallback);

Description

Sets the session event callback.

The callback passes session events to a client. Until it is set, all incoming session events are consumed by the session.

Parameters

MHTTPSessionEventCallback* aSessionEventCallback

Session event callback


SendSessionEventL()

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

Description

Sends a session event.

Parameters

THTTPSessionEvent aStatus

Session event to send

THTTPEvent::TDirection aDirection

Event direction

THTTPFilterHandle aStart=THTTPFilterHandle::EClient

First filter to handle this


FailSessionEvent()

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

Description

Indicate that sending a session event has failed.

Parameters

THTTPFilterHandle aStart = THTTPFilterHandle::EClient

First filter to handle this


OpenL()

void OpenL();

Description

Opens the session using the default protocol, HTTP over TCP.

Leave codes

This function leaves with an appropriate code if the open failed.


OpenL()

void OpenL(const TDesC8& aProtocol);

Description

Opens the session using the specified protocol.

Parameters

const TDesC8& aProtocol

The protocol required

Leave codes

This function leaves with an appropriate code if the open failed.


OpenL()

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

Description

Opens the session using the specified protocol, and receives a filter configuration callback.

This method should be used if configuring the installed filters is required. Once construction of the session is complete, aSessionCallback is called passing in a TFilterConfigurationIterator to allow the filters that are installed to be configured.

Parameters

const TDesC8& aProtocol

The protocol required

MHTTPFilterCreationCallback* aSessionCallback

Pointer to the object providing the call back method

Leave codes

This function leaves with an appropriate code if the open failed.

See also:


ListAvailableProtocolsL()

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

Description

Lists all the available protocols.

Descriptors for each protocol are added to the descriptor array passed in. Any existing data in the descriptor array is deleted.

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.

Leave codes

This function leaves with the appropriate array code if the descriptor array can not be updated.


OpenTransactionL()

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

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=RStringF()

The transaction method (e.g. HTTP::EGET for an HTTP get)

Return value

RHTTPTransaction

The new transaction

Leave codes

KErrNoMemory

Out of memory


Close()

void Close();

Description

Closes the session.

All transactions will be stopped and closed.


GetTable()

static const TStringTable& GetTable();

Description

Gets the framework's string pool table.

Return value

TStringTable&

The string pool table


StringPool()

RStringPool StringPool() const;

Description

Gets the framework's string pool.

Return value

RStringPool

A handle for the string pool


ConnectionInfo()

RHTTPConnectionInfo ConnectionInfo() const;

Description

Gets the connection information for this session,

These settings are used for all transactions in the session. Note that typically the connection information should be set up before the first transaction is created.

Return value

RHTTPConnectionInfo

A handle to the connection information


FilterCollection()

inline RHTTPFilterCollection FilterCollection() const;

Description

Gets the filter collection.

Note that the filter collection cannot be edited after the first transaction has been created.

Return value

RHTTPFilterCollection

The filter collection


RequestSessionHeadersL()

RHTTPHeaders RequestSessionHeadersL();

Description

Gets the request session headers.

These headers 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

The request session headers


ResponseSessionHeadersL()

RHTTPHeaders ResponseSessionHeadersL();

Description

Gets the response session headers.

These headers will get added to each response if the corresponding header does not already exist.

Return value

RHTTPHeaders

The response session headers


operator==()

TBool operator ==(RHTTPSession aTrans) const;

Description

Equality operator.

Parameters

RHTTPSession aTrans

The session to compare with

Return value

TBool

ETrue if equal, EFalse if not


operator()

TBool operator !=(RHTTPSession aTrans) const;

Description

Inequality operator.

Parameters

RHTTPSession aTrans

The session to compare with

Return value

TBool

ETrue if unequal, EFalse if not


ServerCert()

TInt ServerCert(TCertInfo& aServerCert);

Description

Gets the server certificate information for this session.

This function should only be used for WSP sessions. For HTTP, use RHttpTransaction::ServerCert().

Parameters

TCertInfo& aServerCert

On return, the server certificate information

Return value

TInt

KErrNone if certificate has been completed, KErrNotSupported if this function is called for HTTP.

See also:


ConnectL()

void ConnectL();

Description

Connects a session.

This function is required for WSP. It does nothing when used with HTTP.


DisconnectL()

void DisconnectL();

Description

Disconnects a session.

This function is required for WSP. It does nothing when used with HTTP.

[Top]


Internal members

Description

This is internal and not intended for use.


iImplementation

private: CHTTPSession* iImplementation;

Description

This is internal and not intended for use.