jamesmontemagno / Xamarin.Plugins

Cross-platform Native API Access from Shared Code!
MIT License
1.3k stars 380 forks source link

Connectivity for android, deadlock solved #200

Closed rihadavid closed 8 years ago

rihadavid commented 8 years ago

new InetSocketAddress(host, port); can take minutes when on wifi with poor or none internet connectivity. Moving it to new thread and creating timeout delay in new task solves the problem. Creating delay Task does not solve the problem, calling await Task.WhenAny(Task.Delay(5000), CrossConnectivity.Current.IsRemoteReachable(host, 80, 5000)); takes minutes too.