I guess you have forgotten to add the declaration

    <uses-permission
        android:name="android.permission.INTERNET" />

to your AndroidManifest.xml. That's why just the localhost is
reachable.

On Dec 25 2010, 10:30 pm, bc <[email protected]> wrote:
> Has anybody else had any problems using isReachable?
>
> boolean _blnStatus =
> InetAddress.getByName("localhost").isReachable(55000);
>
> I have tried unreasonable timeouts (55000 ms) and it never works? When
> I use localhost it returns true almost instantly. If I try an external
> host (one I know that is working) it always returns false after the
> timeout.
>
> I have verified this issue on the emulator, HTC G1 (ADP1) running 1.6,
> and an HTC Incredible running 2.2 update 1. I have tried both SDK r06
> and r08.
>
> I am completely stumped. This has always worked in the past. Only
> recently have I noticed this no longer works. Has something changed in
> the API?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to