MMsgConnManager Class Reference

class MMsgConnManager

Member Functions Documentation

AddEventSubscriberL(MMsgBearerObsCallback *)

voidAddEventSubscriberL(MMsgBearerObsCallback *aClient)[pure virtual]

Add an object to the queue of listeners. The object to be added must inplement the interface MMsgBearerObsCallback in order to receive events from the system agent. It is important to note that the call to the notification handler (HandleBearerEventL()) takes place inside the RunL() method of this Connection Manager, so the listening object MUST return the control to the Manager AS SOON AS POSSIBLE in order not to clog the scheduler.

Parameters

MMsgBearerObsCallback * aClient

CancelStartL()

voidCancelStartL()[pure virtual]
Cancel StartConnection(). The method may leave with
  • KErrAbort if the TRequestStatus object the client supplied is not active, hence, there is no pending request that would require cancelling. In normal cases - when RConnection::Start() or its progress notifications are pending - ConnMan completes the client's request with the "error" KErrCancel.

Connection()

RConnection &Connection()[pure virtual]

Returns a reference to the currently open connection

Destroy()

voidDestroy()[pure virtual]

Destructor. Must be called when the services of the manager are no longer needed. This is merely a wrapper to the C++ destructor.

It is highly advisable that a client of this API ALWAYS Destroy()s the instance it owns only after it has disposed of all other connection-related components at its command. This is because the other components may still be dependent on the RConnection and RSocketServ instances provided by this object.

NumberOfActiveConns()

TInt NumberOfActiveConns()[pure virtual]

Returns the number of active connections currently open

ReadFromCommsDbLC(const TSupportedCommDbRecords)

HBufC *ReadFromCommsDbLC(const TSupportedCommDbRecordsaParameter)[pure virtual]

Read data from the Comms Database

Parameters

const TSupportedCommDbRecords aParameter

RemoveEventSubscriber(MMsgBearerObsCallback *)

voidRemoveEventSubscriber(MMsgBearerObsCallback *aClient)[pure virtual]

Remove an object from the queue of listeners. It is not necessary to call this method at deletion time, as the destructor destroys the subscriber queue altogether. If, however, a listener object is destroyed (or is likely to be) before an instance of Connection Manager, it is mandatory to remove the listener from the queue prior to deleting the listener.

Parameters

MMsgBearerObsCallback * aClient

SetAccessPointIDL(const TInt)

voidSetAccessPointIDL(const TIntaAccessPointID)[pure virtual]

Set the ID of the Access Point to connect to. Note that this function is effective only when there is no active connection the start of which has been initiated by the client. In other words, the ID of the desired Access Point can be changed only BEFORE calling StartConnection().

May leave with
  • KErrNotFound if the Access Point ID does not exist

Parameters

const TInt aAccessPointID

SocketSession()

RSocketServ &SocketSession()[pure virtual]

Returns a reference to the active socket server.

StartConnection(TRequestStatus &)

voidStartConnection(TRequestStatus &aStatus)[pure virtual]

Start a connection. This asynchronous request completes as soon as a connection has been successfully opened or an error condition has been detected.

Completes with:

  • KErrNone if a connection has been succesfully opened

  • KErrNotReady if client has called StopConnection() and attempts to start a new connection before the previous one has been disconnected.

  • KErrAlreadyExists if a client attempts to open a connection while one is already being opened

  • KErrTimedOut if the specified timeout value expires

Parameters

TRequestStatus & aStatusRequest status of the client.

Status()

TBool Status()const [pure virtual]

Returns the state of this connection manager:

  • ETrue, if a connection is available

  • EFalse otherwise; bearer suspended, StartConnection() failed etc.

A component that wishes to send/receive data is encouraged to call this function before opening a socket, or reading from or writing to one. This way it can be assured that no component prompts up that annoying IAP dialog.

StopConnection()

voidStopConnection()[pure virtual]

Stop a connection, synchronous version

StopConnection(TRequestStatus &)

voidStopConnection(TRequestStatus &aStatus)[pure virtual]

Stop a connection. This asynchronous request completes as soon as a connection has been closed. Note that it takes a few seconds for the connection to really wear out. Thus, when a client calls this function, it should really mean what it is saying, because a new connection CANNOT BE OPENED before a previous one has been deactivated.

The request may complete with
  • KErrNone if connection closing is successful

  • KErrAbort if call takes place while connection initiation is ongoing or if there is no active connection that would require closing. If a connection initiation is ongoing client should use CancelStartL() method instead.

Parameters

TRequestStatus & aStatusRequest status of the client