java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:90)
at java.net.SocketInputStream.read(SocketInputStream.java:71)
at java.io.InputStreamReader.fill(InputStreamReader.java:163)
at java.io.InputStreamReader.read(InputStreamReader.java:239)
at java.io.BufferedReader.fill(BufferedReader.java:137)
at java.io.BufferedReader.readLine(BufferedReader.java, Compiled Code)
at java.io.BufferedReader.readLine(BufferedReader.java, Compiled Code)
Java provides a mechanism in the Socket class which allows you to set a timeout period on a per-socket basis. By invoking the setSoTimeout(int) method before you attempt a read() operation on the socket, for example, you may specify how long, in milliseconds, the socket should wait before the read throws a java.io.InterruptedIOException. A value of zero means wait forever.