Namespaces
Variants
Actions
Revision as of 09:09, 12 March 2012 by hamishwillee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

No notification from Connection Monitor Server API (Known Issue)

Jump to: navigation, search

The Connection Monitor Server API (ConnMon) does not send a notification if two different applications connect to the network through the same access point(AP) and using the same network bearer.

Article Metadata

Tested with
Devices(s): All(S60)

Compatibility
Platform(s): S60 3rd Edition, S60 3rd Edition FP1, S60 3rd Edition FP2, S60 5th Edition

Article
Keywords: EConnMonCreateConnection
Created: User:Kbwiki (23 Dec 2009)
Last edited: hamishwillee (12 Mar 2012)

Description

The Connection Monitor Server API (ConnMon) sends a notification (EConnMonCreateConnection) when a new connection is created. However, when there's already an active connection and another application requests a connection, the existing connection is shared between both applications. ConnMon does not send a notification in this situation as no new connection is established.

A new connection would be established only if the application specifically requests a different bearer (for instance, WLAN vs. GPRS) or a connection method (IAP) with a different access point name (APN).

Solution

Instead of monitoring subconnections, it's possible to request connection attributes from the Connection Monitor Server. This can be done by using the KClientInfo parameter for the function RConnectionMonitor::GetPckgAttribute().

With the following code, it's possible to detect if there are other applications using the same connection:

 TRequestStatus status; 
TConnMonClientEnumBuf clientBuf;
 
// connectionId is the ID value of a specific connection. Connection IDs
// can be obtained with RConnectionMonitor::GetConnectionInfo()
 
monitor.GetPckgAttribute( connectionId, 0, KClientInfo, clientBuf, status );
User::WaitForRequest( status );
 
if( status.Int() == KErrNone )
{
// Count of the clients using the connection
TUint count = clientBuf().iCount;
// The uid of the first client (there are max 10 UIDs in the array)
TUid uid = clientBuf().iUid[0];
}

The KClientInfo attribute is used to retrieve the client UID for all clients using a specific connection. The information is transferred through a package of type TConnMonClientEnumBuf. The package class has a fixed size array, and it is limited to a maximum of 10 (KConnMonMaxClientUids) UIDs.

178 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved