Consider the following snippet:
URLConnection connection = target.openConnection(); connection.setConnectTimeout(5000); // 5 sec connection.setReadTimeout(1
you are right! connection.setReadTimeout not mean read complete, it mean when wait for 10s, when there're no more data read in, will throw a timeoutexception.
connection.setReadTimeout