tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Cohen (ETL)" <>
Subject RE: Multiple GETs on an SSLSocket
Date Tue, 12 Dec 2000 11:27:04 GMT
Hi Ken,
Thanks for your suggestion. Certainly helped but not the whole ten
yards. I found that by not reading the 'null' at the end of the buffer
the IO exception is not thrown. I did this using the ready() method of
BufferedReader. ready() returns false if there is no data in the buffer
to be read. When it returns false I break out of the loop and send the second
GET request to the server. So the second GET doesn't cause a IO error. The problem
is that it doesn't cause the second page of html to be downloaded. The buffer just
remians in state 'not ready'. 

Right now I'm trying to get it working from the servlet and have run into an
unrelated problem.

I'll let you if I find a solution.

Thanks again.

> Have you tried this on a non-SSL connection?
> A general problem with the IO in java (afaik) is that, if you 
> read from the
> stream, such that you get a -1 returned, then the stream is 
> effectively
> closed. You have to reconnect (I haven't tried SSL on this, 
> but a plain
> socket works like this). If you can control the sending 
> response, ensure
> either the content-length is specified or the stream is 
> chunked so that you
> can know when to stop reading -- avoiding getting a -1. YOu 
> can then reuse
> the socket, without reconnecting.
> Ken
> on 08/12/2000 06:25:10
> Please respond to
> To:
> cc:    (bcc: Ken X Horn)
> Subject:  Multiple GETs on an SSLSocket
> Hi,
> This is more a java/ssl question then tomcat but any ideas on 
> the following
> will be
> much appreciated...
> I'm using a servlet (will be using a servlet at the moment 
> I'm testing in a
> standalone app.)
> as a client to connect via https to a server. I've got as far 
> as making the
> server trusted and performing the ssl handshake and then 
> downloading the
> first html page.
> The problem arises when I try to write the second GET request 
> and flush it
> down
> the output stream. The flush() method throws an IOException. 
> I'm using the
> sample code
> provided with jsse to implement things but that sample code 
> only has one
> GET request and
> so works fine. The exception comes with the second GET?
> Any ideas?
> Mike C.

View raw message