Java socket wait more than 1min to try connect with server -


this question has answer here:

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

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -