This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes SSLSocket Read timed out issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "SSLSocket Read timed out issue" Watch "SSLSocket Read timed out issue" New topic

SSLSocket Read timed out issue

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345


I'm facing problems with reading the bytes written on a SSLSocket. Following is what I'm doing:

(1) Sending some bytes to a server which has an SSLSocket opened
(2) I'm able to see the bytes that I have sent to the server (printed the log lines on the server)
(3) The server send its response and I'm able to see the response in the server logs
(4) When I try to read that from my client using DataInputStream that I get from my SSLSocket, I get the following error:

Any ideas on how to get around this? I tried by increasing the time out period..... set it to infinite also did not help.

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345

When I set the timeout parameter (the call to the setSoTimeout() method) as setSoTimeout(0*1000), there seems to be nothing happening... the program is standstill... looks like my client is waiting for reading something on the InputStream written by the server. I'm totally confused and seems like I'm about to hit a dead end.
It is sorta covered in the JavaRanch Style Guide.
subject: SSLSocket Read timed out issue
Similar Threads
web service security issue
ObjectInputStream.readObject() hangs forever during socket communication
Program to send Email using JavaMail not working.
SSL enabled client code with client authentication