You have two options. Reduce the timeout of the check or create a new thread. The more correct solution would be to create a new thread to handle the connection test. Lag times on an internet connection can be on the order of one second for a badly congested network. A UI that stalls for that long is not good form.
So your thread would be updating connection status every 30 second and using some form of inter-thread communication to send that to your main thread. The main thread only looks at the last known communication status to make its decision.
Main Topics
Browse All Topics





by: drakeshePosted on 2009-05-06 at 23:30:01ID: 24322805
Whatever control you are using to access the internet must have a 25 second time out.