exception - SocketTimeoutException - "timeout" "read timed out" -


i writing tests run okhttp/retrofit requests against mockwebserver. among other things i'm testing timeouts. here noticed, of timeout tests do not produce same kind of exception time:

while exception thrown sockettimeoutexception, exception message differs between 2 possibilities. get

  • "timeout", sometimes
  • "read timed out".

there seems no clear pattern (it's same test produces 1 or other of these exception messages).

i assume different constellations/causes lead differing messages... can explain me difference between these 2 cases?


here corresponding stack traces:

"read timed out"

caused by: java.net.sockettimeoutexception: read timed out     @ java.net.socketinputstream.socketread0(native method)     @ java.net.socketinputstream.socketread(socketinputstream.java:116)     @ java.net.socketinputstream.read(socketinputstream.java:170)     @ java.net.socketinputstream.read(socketinputstream.java:141)     @ okio.okio$2.read(okio.java:140)     @ okio.asynctimeout$2.read(asynctimeout.java:238)     @ okio.realbufferedsource.read(realbufferedsource.java:45)     @ okhttp3.internal.http.http1xstream$fixedlengthsource.read(http1xstream.java:381)     @ okio.realbufferedsource.read(realbufferedsource.java:45)     @ okio.forwardingsource.read(forwardingsource.java:35)     @ retrofit2.okhttpcall$exceptioncatchingrequestbody$1.read(okhttpcall.java:279)     @ okio.realbufferedsource$1.read(realbufferedsource.java:386)     @ sun.nio.cs.streamdecoder.readbytes(streamdecoder.java:284)     @ sun.nio.cs.streamdecoder.implread(streamdecoder.java:326)     @ sun.nio.cs.streamdecoder.read(streamdecoder.java:178)     @ java.io.inputstreamreader.read(inputstreamreader.java:184)     @ com.google.gson.stream.jsonreader.fillbuffer(jsonreader.java:1287)     @ com.google.gson.stream.jsonreader.nextquotedvalue(jsonreader.java:1016)     @ com.google.gson.stream.jsonreader.nextname(jsonreader.java:787)     @ com.google.gson.internal.bind.typeadapters$29.read(typeadapters.java:739)     @ com.google.gson.internal.bind.typeadapters$29.read(typeadapters.java:714)     @ com.google.gson.internal.bind.typeadapters$35$1.read(typeadapters.java:910)     @ retrofit2.converter.gson.gsonresponsebodyconverter.convert(gsonresponsebodyconverter.java:37)     @ retrofit2.converter.gson.gsonresponsebodyconverter.convert(gsonresponsebodyconverter.java:25)     @ retrofit2.servicemethod.toresponse(servicemethod.java:117)     @ retrofit2.okhttpcall.parseresponse(okhttpcall.java:211)     @ retrofit2.okhttpcall$1.onresponse(okhttpcall.java:106) 

"timeout"

caused by: java.net.sockettimeoutexception: timeout     @ okio.okio$3.newtimeoutexception(okio.java:212)     @ okio.asynctimeout.exit(asynctimeout.java:288)     @ okio.asynctimeout$2.read(asynctimeout.java:242)     @ okio.realbufferedsource.read(realbufferedsource.java:45)     @ okhttp3.internal.http.http1xstream$fixedlengthsource.read(http1xstream.java:381)     @ okio.realbufferedsource.read(realbufferedsource.java:45)     @ okio.forwardingsource.read(forwardingsource.java:35)     @ retrofit2.okhttpcall$exceptioncatchingrequestbody$1.read(okhttpcall.java:279)     @ okio.realbufferedsource$1.read(realbufferedsource.java:386)     @ sun.nio.cs.streamdecoder.readbytes(streamdecoder.java:284)     @ sun.nio.cs.streamdecoder.implread(streamdecoder.java:326)     @ sun.nio.cs.streamdecoder.read(streamdecoder.java:178)     @ java.io.inputstreamreader.read(inputstreamreader.java:184)     @ com.google.gson.stream.jsonreader.fillbuffer(jsonreader.java:1287)     @ com.google.gson.stream.jsonreader.nextquotedvalue(jsonreader.java:1016)     @ com.google.gson.stream.jsonreader.nextname(jsonreader.java:787)     @ com.google.gson.internal.bind.typeadapters$29.read(typeadapters.java:739)     @ com.google.gson.internal.bind.typeadapters$29.read(typeadapters.java:714)     @ com.google.gson.internal.bind.typeadapters$35$1.read(typeadapters.java:910)     @ retrofit2.converter.gson.gsonresponsebodyconverter.convert(gsonresponsebodyconverter.java:37)     @ retrofit2.converter.gson.gsonresponsebodyconverter.convert(gsonresponsebodyconverter.java:25)     @ retrofit2.servicemethod.toresponse(servicemethod.java:117)     @ retrofit2.okhttpcall.parseresponse(okhttpcall.java:211)     @ retrofit2.okhttpcall$1.onresponse(okhttpcall.java:106) 


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -