Java socket wait more than 1min to try connect with server -
this question has answer here:
- setting timeout socket operations 5 answers
socket requestsocket = new socket(a, 6666);
when try connect serwer , server unavailable gave wait 1 min or more see ja
va.net.connectexception: failed connect /192.168.43.50 (port 6666): connect failed: etimedout (connection timed out) 09-14 08:36:02.705 3244-3345/net.simplifiedcoding.navigationdrawerexample w/system.err: @ libcore.io.iobridge.connect(iobridge.java:114)
how can set lower time try connect server ?
i suppose you're using socket.connect(socketaddress) method. there socket.connect(socketaddress, int) can specify timeout second parameter. hope helps!
Comments
Post a Comment