Socket.connect doesn't throw exception in Android -


if put nonsense url no exception thrown , none of rest of code executed not rest of asynctask called method connects.

try {         socketcliente.connect(new inetsocketaddress("f", port), 2000);      } catch (unknownhostexception e) {         geterror("host doesn't exist");         return -1;     } catch (ioexception e) {         geterror("could not connect: host down");         return -1;     } 

add catch statement.

catch ( exception e ) {     log.d(tag, e.getmessage(),e);     toast.maketext(getapplicationcontext(), "unexpected error:" + e.getmessage(), toast.length_long).show(); } 

this write log , pop toast tell what's going on.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -