Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #android #set #socket #timeout
ADD COMMENT
Topic
Name
1+3 =