Force an Internet connection

  • Thread starter Thread starter Hilton
  • Start date Start date
H

Hilton

Hi,

It seems that my app won't 'speak Internet' unless I first open IE and get
some page; i.e. IE starts the Internet connection. If I don't firt run IE
(and have it open a page), then my app doesn't get the connection.

How do I go about getting my C# app to work without first running IE?

Thanks,

Hilton
 
You need to communicate with the Connection Manager, if you're talking about
Pocket PC or Smart Phone, and ask to be connected. OpenNETCF has a
Connection Manager wrapper, or you can write your own set of P/Invokes for
native code calls.

Paul T.
 
Just checked and it is up now.

-Chris


Hilton said:
Paul,

Thanks for that, I'll take a look. Is the server down? Both the web
interface and vault seem busted at 11:20am today.
(http://www.opennetcf.org)

Thanks,

Hilton


"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
You need to communicate with the Connection Manager, if you're talking
about Pocket PC or Smart Phone, and ask to be connected. OpenNETCF has a
Connection Manager wrapper, or you can write your own set of P/Invokes
for native code calls.

Paul T.
 
Hi,

OK, I'm getting close with ConnectionManager, but I'd like someone to tell
me the advantages and disadvantages of the following:

Exclusive versus non-exclusive - seem like exclusive allows my app to close
the connection, but why would it want to? I'm assuming IE is opening a
non-exclusive connection since my app can use the connection, so should I
use "non-exclusive"? BTW: The example uses "exclusive".

Asynchronous - Why/when etc would you use asynchronous versus synchronous
and what exactly do these mean?

Are there any 'gotchas'? e.g. if I leave the connection open, will it
drain the battery, pervent the PPC/SP from sleeping etc?

Thanks,

Hilton
 
Hilton said:
Hi,
[snip]

Asynchronous - Why/when etc would you use asynchronous versus synchronous
and what exactly do these mean?

Synchronous normally means your app. waits until that function call has
returned and if it never returns it hangs too at least while the
function is processing you can't do anything in your app.

Async. normally means: fire the call and continue with processing.
Gotcha here: it may take some time for the call to finish so if you're
dependant on the resultcode you've to query this somehow. But: while
being in a query loop or so you may do other things in your app. and the
app. seems to be responsive. => Async. normally is more powerfull.

Greetings

Markus
 
Hi

In our application we use exclusive connections, although it doesn't
seem to prevent other apps from using the connection, for example, our
app initiates the GPRS connection in exclusive mode, then apps like pIE
and vxUtil can use that connection for fetching web pages and pinging
servers etc.

Synchronous calls will block until the call has completed, so if you
are in a single threaded app this will halt your application until the
call returns. Async will return from the call straight away and will
usually then notify your application via a message or a callback (or
events in .net) that the action has completed. This allows your app to
still function whilst the function completes.

Once you have established the connection it will stay active if the
device suspends, certainly it does on the majority of the pocket pc
devices our app is run on.

One other thing we have found is occasionally the device will think
it's connected to the GPRS network, however we can't actually
communicate with a server successfully. In these circumstances we tend
to disconnect and reconnect the gprs connection. This is especially the
case when the device is mobile and moving from cell to cell, or going
in and out of coverage.

HTH

Matt
 
Back
Top