ConnMgrSetConnectionPriority

The ConnMgrSetConnectionPriority function changes the priority of the current connection.

Syntax

HRESULT WINAPI ConnMgrSetConnectionPriority(
  HANDLE hConnection,
  DWORD dwPriority 
);

Parameters

  • hConnection
    Handle to the current connection; the ConnMgrEstablishConnection function returns the value of this parameter.
  • dwPriority
    The priority value of the structure, which contains one of the CONNMGR_PRIORITY_* values described in the following table. The flags are listed in order, from highest priority to lowest priority.
    Value Description
    CONNMGR_PRIORITY_VOICE Voice connection; highest priority.
    CONNMGR_PRIORITY_USERINTERACTIVE A user-initiated action caused this request, and the user interface is waiting on the creation of this connection.

    This flag is appropriate for an interactive browsing session or if the user selects "MORE" at the bottom of a truncated mail message (for example).

    CONNMGR_PRIORITY_USERBACKGROUND A user-initiated connection that has recently become idle.

    A connection should be marked as idle when it is no longer the user's current task.

    CONNMGR_PRIORITY_USERIDLE Interactive user task that has been idle for an application-specified amount of time.

    As the user runs the application, to help Connection Manager optimize responsiveness to the interactive application while sharing the connection with background applications, the application should toggle the state between CONNMGR_PRIORITY_USERIDLE and CONNMGR_PRIORITY_
    USERINTERACTIVE.

    CONNMGR_PRIORITY_HIPRIBKGND High priority background connection.
    CONNMGR_PRIORITY_IDLEBKGND Idle priority background connection.
    CONNMGR_PRIORITY_EXTERNALINTERACTIVE The connection is requested on behalf of an external entity but is an interactive session (AT Command Interpreter, for example).
    CONNMGR_PRIORITY_LOWBKGND The lowest priority connection.

    Connects only if a higher priority client is already using the same path.

Return Values

None.

Remarks

Connection Manager arbitrates among multiple connections, satisfying as many as possible at a time but giving preference to higher priority connection types.

This function is useful if you want to change the priority of a specific task after it begins running. For example, you can prevent a connection from being interrupted or halted if you increase the priority of that connection after it starts running.

Requirements

Smartphone: Windows Mobile 2002 and later
OS Versions: Windows CE 3.0 and later
Header: connmgr.h
Library: cellcore.lib

See Also

Connection Manager

Connection Manager API Functions

ConnMgrEstablishConnection

Last updated on Friday, April 22, 2005

© 2005 Microsoft Corporation. All rights reserved.

Send feedback on this topic to the authors.