Re: Avoid application hanging
- From: "Tim De Vogel" <tim@xxxxxxxxx>
- Date: Fri, 3 Feb 2006 14:00:57 +0100
This looks like an easy and good suggestion. I'll try this!
Thank you all for taking the time to reply.
--
Tim De Vogel
S-Data NV
http://www.s-data.be
"allen" <allen@xxxxxxxxxxxxxxxxxxxxxxxxx> schreef in bericht
news:4CE08714-E850-4D6E-BF6D-E7701F35D160@xxxxxxxxxxxxxxxx
You could also use the System.Net.Dns class to determine the current IP
address for the device. anything other than 127.0.0.1, and you should
have a
valid network connection.
sample code would look something like:
IPHostEntry hostInfo = Dns.GetHostByName(Dns.GetHostName());
if ((hostInfo != null) && (hostInfo.AddressList != null) &&
(hostInfo.AddressList.Length > 0)) {
if (0 != string.Compare("127.0.0.1",
hostInfo.AddressList[0].ToString(), false, CultureInfo.CurrentUICulture) {
// valid network connection
}
else {
// invalid network connection
}
}
else {
// invalid network connection
}
"Tim De Vogel" wrote:
Hi,
I developed a pocketpc application that connects directly to a SQL Server
(so not the mobile CE edition) usign wifi. My problem is that when the
server / wifi is unavailable (due to bad connection, server restart or
whatever) the mobile application hangs, even with a try.. catch around
the
connection parts. Is there a clean way to "detect" for the sql server
availability or to at least make sure my application doesn't hang and
gives
a proper msgbox failure instead of having to go to memory manager to quit
the application?
--
Tim De Vogel
S-Data NV
http://www.s-data.be
.
- References:
- Avoid application hanging
- From: Tim De Vogel
- Avoid application hanging
- Prev by Date: Re: NetCF and OpenNETCF, is necessary to install ?
- Next by Date: Re: Context menu position
- Previous by thread: Re: Avoid application hanging
- Next by thread: Re: WinMobile Appointments database
- Index(es):
Relevant Pages
|