Hi,

If I have the following code:

try
{
        Socket mySocket = new Socket("a.b.c.d", 5000);
}

catch (UnknownHostException ex)
{
        ex.printStackTrace();
}

catch (ConnectException ex)
{
        ex.printStackTrace();
}

catch(IOException ex)
{
        ex.printStackTrace();
}

I'm trying to catch the case where the host (a.b.c.d) is not
available.

On the emulator it hits IOException after maybe a minute or so, but
on
the device it hits ConnectException pretty much immediately.

Is there a reason why you get different exceptions on device and
emulator. Is there a way to reduce the timeout on the emulator?
thanks

--~--~---------~--~----~------------~-------~--~----~
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