开发者

Android - Maximum Timeout for InetAddress isReachable()

I'm using InetAddress.getByName(params[0]).isReachable(300000) to determine if my NAS is alive. By measuring the time before and after the above methode I found out that the timeout has a maximum of about 3 min. 10 seconds, even if I set the timeout to 600000 (about 10 minutes).

Am I doing something wrong? Or is ther开发者_如何学Ce a better way to implement such function?

regards, Thomas


I've changed my approach. Now I'm using Runtime.getRuntime().exec to execute a ping to the remote-ip. That's more reliable than isReachable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜