Ping 4 CF1 - PPC2002 before SQLCE syncing

  • Thread starter Thread starter Saverio Tedeschi
  • Start date Start date
S

Saverio Tedeschi

Hi all gurus,
can pls some1 point me to the right direction on how to ping an address,
even if not DNSed. Actually, I've to SQLCE-sync over an 802.11b network, and
in order to save time wasting, I'd like to ping (briefly) just before
syncing, and if this test fails, let user know that hs/she isn't in a good
coverage area, so that can recovery. BTW, what do you think of such a
solution? I've found a PING sample by Alex Feinman but this, altough I think
it's OK, doesn't work in my environment as I think it uses CF2 features
(when I try to run, throws a MissingMethodException). TIA for any clue. Have
a nice day.
 
Actually you are getting MissingMethodException because iphlpapi.dll does
not exist on PPC2002. It has been introduced in WM2003 (CE.NET 4.0 to be
exact).
To implement ping on PPC2002 you will need to write some C++ code - it is
too complex for CF app. You might want to consider an alternative. Use
Socket in asynchronous mode to attempt socket connection to port 80 of your
host. If it did not connect in 1 sec, you can safely abort it and consider
the host unreachable
 
Thank you Alex 4 your reply. Unfortunately you confirm what I feared. On the
other hand, it should be possible to write, as you say, a "IcmpHelper.dll"
in eVC 3.0 so I could perform ping from inside my app. If someone has some
sample code... But I guess this is OT. Have a nice day!
 
FWIW, I ended up issuing a WebRequest (immediately aborted) to the IIS
address with CE sync dir. This way it takes longer, but SQL connection is
tested as well. Nice day 4 every1.
 
Back
Top