Answers for "android set socket timeout"

0

android set socket timeout

// see https://developer.android.com/reference/java/net/Socket#setSoTimeout(int)

try {
  mSocket.setSoTimeout(10*1000);
  // OR
  mSocket.connect(address, 10*1000);
} catch (SocketTimeoutException e) {
  // on timeout
}
Posted by: Guest on October-02-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language