ConnMgrReleaseConnection
A version of this page is also available for
4/8/2010
This function deletes a specified connection request, potentially dropping the physical connection.
Syntax
HRESULT WINAPI ConnMgrReleaseConnection(
HANDLE hConnection,
LONG lCache
);
Parameters
- hConnection
[in] Handle to the connection, returned from a call to ConnMgrEstablishConnection.
lCache
[in] The number of seconds to cache the connection before disconnection occurs. This parameter accepts values described in the following table.Value Description A value greater than 1
The number of seconds to cache the connection before disconnection occurs.
1
The default cache time value, as specified by the HKEY_LOCAL_MACHINE\Comm\ConnMgr\Planner\Settings registry key. The CacheTime registry setting defines the default for nonexclusive connections and the VPNCacheTime registry setting defines the default for exclusive connections.
0
The connection request is not cached. The disconnection occurs immediately, unless any of the following are true:
- The connection or connections are still being used by other connection requests.
- The connection is configured as Suspend/Resume (S/R) capable. For more information, see Making Suspend and Resume Connections During Voice Calls.
- The connection is configured as AlwaysOn. For more information, see Making an AlwaysOn Data Connection.
Note
Some Windows Mobile devices ignore the specified value of this parameter and instead use the default value (60 seconds).
- The connection or connections are still being used by other connection requests.
Return Values
Returns S_OK if successful or an error code if the function call failed.
Remarks
Connection Manager does not cache the following types of connections:
- Suspended connections
- Disconnected connections
- Connections without a DestId (that is, when the connection was provisioned using provisioning XML, a DestId was not specified)
- Fixed path connections (that is, a connection where the destination GUID is set to be an existing network connection that is managed with Connection Manager)
Requirements
Header | connmgr.h |
Library | cellcore.lib |
Windows Embedded CE | Windows CE .NET 4.2 and later, Windows Embedded NavReady 2009 |
Windows Mobile | Windows Mobile Version 5.0 and later |
See Also
Tasks
Reference
ConnMgrEstablishConnection
Connection Manager Functions
Concepts
Making Suspend and Resume Connections During Voice Calls
Making an AlwaysOn Data Connection