Home > Archive > Smartphone Developer Forum > March 2006 > ConnMgr and Handle-less Connection Status
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
ConnMgr and Handle-less Connection Status
|
|
| csoltero@NaObSaPcAoMmobile.com 2006-01-27, 7:04 pm |
| Hello all.
I would like to use the Connection Manager API to see what
connection(s) are currently connected. As far as I've seen, I can use
ConnMgrConnectionStatus to get the information. However, that function
requires a HANDLE to that connection, which is acquired via
ConnMgrEstablishConnectionSync.
Now, if I enumerate the connections, then get the handle in order to
check status, does that mean that there will be a connection attempt
request for each connection?
Is there a way to get the connection status without issuing a
connection request (sync or async)? I'm thinking one workaround could
be to use a short (100-500ms) timeout in EstablishConnectionSync, so if
the connection is already connected, it will immediately return.
Otherwise (if not connected), it will "immediately" timeout. Sounds
kind of hack-ish to me, though.
In case platform is relevant here, I intend to target WM 2003 and
higher (SmartPhone and others).
Thanks in advance!
-Carlos
| |
| Yaroslav Goncharov 2006-03-20, 3:58 am |
| You should use an async version of this API, ConnMgrEstablishConnection.
Then you can listen for events on this handle. Please let me know you have
more questions or problems.
--
Yaroslav Goncharov
Spb Software House
"csoltero@NaObSaPcAoMmobile.com" <c_soltero_pales@hotmail.com> wrote in
message news:1138376847.030333.166150@g47g2000cwa.googlegroups.com...
> Hello all.
>
> I would like to use the Connection Manager API to see what
> connection(s) are currently connected. As far as I've seen, I can use
> ConnMgrConnectionStatus to get the information. However, that function
> requires a HANDLE to that connection, which is acquired via
> ConnMgrEstablishConnectionSync.
>
> Now, if I enumerate the connections, then get the handle in order to
> check status, does that mean that there will be a connection attempt
> request for each connection?
>
> Is there a way to get the connection status without issuing a
> connection request (sync or async)? I'm thinking one workaround could
> be to use a short (100-500ms) timeout in EstablishConnectionSync, so if
> the connection is already connected, it will immediately return.
> Otherwise (if not connected), it will "immediately" timeout. Sounds
> kind of hack-ish to me, though.
>
> In case platform is relevant here, I intend to target WM 2003 and
> higher (SmartPhone and others).
>
> Thanks in advance!
>
> -Carlos
>
|
|
|
|
|