关闭GPRS连接在Windows Mobile

问题描述:

是否有可能获得所有打开或缓存的gprs在Windows Mobile和方案强迫他们连接关闭?

Is it possible to get all open or cached gprs connections on windows mobile and programmatic force them to close?

我一直都盼望在连接管理器API,但不能似乎找方法我做到这一点。

Ive been looking at connection manager api but cant seem to find methods I to do this.

问候

托尼

连接管理器可以,你不再使用通过调用 ConnMgrReleaseConnection 的连接通知>,但这并不强行关闭连接。它根据在注册表(HKEY_LOCAL_MACHINE\Comm\ConnMgr\Planner\Settings)中所定义的生存期的缓存,以及在释放请求传递的任何信息是封闭的。 (顺便说一句,这些API被包裹在 SDF 的OpenNETCF的ConnectionManager对象)。

Connection Manager can be notified that you're no longer using the connection by calling ConnMgrReleaseConnection, but that does not forcibly close the connection. It is closed based on the lifetime caching defined in the registry (HKEY_LOCAL_MACHINE\Comm\ConnMgr\Planner\Settings), as well as any info passed in the Release request. (BTW, these APIs are wrapped in the OpenNETCF ConnectionManager objects in the SDF).

要强行关闭连接的唯一方法是使用 RAS 枚举所有设备连接,找到你后的人,并关闭它。请注意,如果你这样做,的ConnectionManager不知道它已经关闭,所以它会尝试使用该连接的下一次被打乱。通常情况下它会在内部得到一个错误,并再次尝试打开一个新的连接,一切都很好,但情况因人而异。

The only way to forcibly close the connection is to use RAS to enumerate all device connections, find the one you're after, and close it. Be aware that if you do this, ConnectionManager doesn't know that it's been closed, so it's going to be upset the next time it tries to use that connection. Typically it will get an error internally and try to open a new connection again and all is well, but YMMV.