Ping - Connection Check

  • Thread starter Thread starter Martin Waller
  • Start date Start date
M

Martin Waller

Hello,

my mobile application for pocket PC must communicate to a server (TCP/IP
wireless). Therefore I use the class TCPClient to open a connection and do
data exchange.
But when the server is temporarily offline on starting my application then
the TCPClient.Connect method runs in a blocking situation with unlimited (?)
timeout and my application is frozen at this time.
What can I do to avoid this?
I tried to use a kind of ping but this command is not available in the
compact framework 1.1. I can not find a property of TCPClient to influence
the blocking mode or connection request timeout.

Thanks for any useful help !!!!!
 
Martin,

use asynchronous communication.
Take a look at the Socket class and there at BeginReceive() EndReceive().

Ping should be available in the OpenNETCF.

Ruediger
 
And, it should be noted, this is *not* an indefinite time-out. It's a
period of time long enough to make sure that the target machine isn't just
all the way around the world on an unreliable network where a few packets
might get dropped occasionally. It should time-out in 45 seconds to 2
minutes, depending on the device settings.

Paul T.
 
Hi,
check the IP address of the device before trying to send.

If it is 127.0.0.1 then you have lost your connection.

Pete
 
Back
Top