Share via


CmGetNextCandidateConnection (Compact 2013)

3/26/2014

This API gets the next candidate connection that can be used by an application to attempt to connect to the specified host.

Syntax

CM_RESULT CmGetNextCandidateConnection(
__in CM_SESSION_HANDLE hSession,
__out CM_CONNECTION_HANDLE* phConnection
);

Parameters

  • phConnection
    [in] A pointer to a storage area to place the output.

    [out] A pointer to a CM_SESSION_HANDLE of the candidate connection.

Return Value

Value

Description

CMRE_SUCCESS

The operation completed successfully.

CMRE_INVALID_SESSION

The hSession is not valid.

CMRE_INVALID_PARAMETER

A parameter other than hSession is invalid.

CMRE_OUT_OF_MEMORY

Memory can not be allocated to complete the operation.

CMRE_NO_CONNECTIONS

There are no more configured connections that meet the requirements and policies of the caller.

CMRE_CONNECTION_ITERATION_NOT_STARTED

Connection iteration has not been started with CmGetFirstCandidateConnection.

CMRE_UNEXPECTED

An unexpected failure occurred.

Remarks

When called repetitively, this function iterates through all the candidate connections that meet the requirements and policies of the caller.

This function requires that you first call CmGetFirstCandidateConnection.

Requirements

Header

cmnet.h

Library

cmnet.lib

See Also

Reference

Connection Manager Connectivity Functions
CM_SESSION_HANDLE
CmGetFirstCandidateConnection