There are two different places for timeouts, socket connections and socket reads. Prior to JDK 1.4, there was no way to set the timeout for socket connections, because the Socket constructor also established the connection. Starting with JDK 1.4, there is also a default constructor that does not establish the connection, and a separate connect method with a timeout parameter. Timeouts for socket reads are set by setSoTimeout, which has been around since early JDKs.
Apache SOAP has called setSoTimeout for some time. Version 2.3.1 calls it. Only the nightly build of Apache SOAP leverages the ability of JDK 1.4 to timeout the connect. If you are using JDK 1.3.x, you can 'hang' on the connection, although I would not continue for an infinite amount of time, as TCP/IP would normally stop trying to establish the connection after a few SYNs are sent. In looking at the code, it appears as if read timeouts are not set before handshaking, which probably makes it possible to hang indefinitely during the handshake. I will make changes to SSLUtils to set read timeouts before handshaking. Scott Nichol Do not send e-mail directly to this e-mail address, because it is filtered to accept only mail from specific mail lists. ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 02, 2003 8:31 AM Subject: Memo: Re: Timeout on SSL sockets > I have tried this before and it seems to work only for HTTP but not HTTPS. > > When looking at the source code in SSLUtils, I found the timeout is set > after the SSL handshaking and I suspect that's the reason why it doesn't > work. I've modified the code to set the timeout before handshaking and it > works - most of the time. For some cases it doesn't work. > > Actually does anyone how the timeout is implemented? Would the timeout > mechanism be not working if my program (which is a multi-thread one) is > extremely busy? > > Billy > > > > > To: [EMAIL PROTECTED] > cc: > > > > Our Ref: > Your Ref: > Subject: Re: Timeout on SSL sockets > > > > I believe you can set the SO_TIMEOUT with Apache SOAP 2.3.1 > > In HTTPUtils, I see this: > > if (timeout > 0) // Should be redundant but not every JVM > likes this > s.setSoTimeout(timeout); > > ... where the SO_TIMEOUT is set after creating the socket ( be it SSL or > non-SSL ). > > > [EMAIL PROTECTED] wrote: > > >Hi all, > > > >I want to have a timeout mechanism when my program send a SOAP message to > a > >server using SSL. It does not work in my version (2.3.1) of Apache SOAP > (my > >program waits indefinitely if the server do not respond). I have browsed > >the nightly builds and found a fix there but it requires JDK 1.4.x. > > > >Anyone know if a fix exists for JDK 1.3.x? > > > >Thanks. > > > >Billy > > > >************************************************************ > >The Hongkong and Shanghai Banking Corporation Limited > >whose registered address is 1 Queen's Road Central, Hong Kong > >************************************************************ > > > > > > > > > > > >********************************************************************** > >This E-mail is confidential. It may also be legally privileged. > >If you are not the addressee you may not copy, forward, disclose > >or use any part of it. If you have received this message in error, > >please delete it and all copies from your system and notify the > >sender immediately by return E-mail. > > > >Internet communications cannot be guaranteed to be timely, > >secure, error or virus-free. The sender does not accept liability > >for any errors or omissions. > >********************************************************************** > > > > > > > > > > > > > -- > Jesus M. Salvo Jr. > Mobile Internet Group Pty Ltd > (formerly Softgame International Pty Ltd) > M: +61 409 126699 > T: +61 2 94604777 > F: +61 2 94603677 > > PGP Public key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC0BA5348 > > > > > > ************************************************************************* > This message originated from the Internet. Its originator may or > may not be who they claim to be and the information contained in > the message and any attachments may or may not be accurate. > ************************************************************************** > > > > > ************************************************************ > The Hongkong and Shanghai Banking Corporation Limited > whose registered address is 1 Queen's Road Central, Hong Kong > ************************************************************ > > > ********************************************************************** > This E-mail is confidential. It may also be legally privileged. > If you are not the addressee you may not copy, forward, disclose > or use any part of it. If you have received this message in error, > please delete it and all copies from your system and notify the > sender immediately by return E-mail. > > Internet communications cannot be guaranteed to be timely, > secure, error or virus-free. The sender does not accept liability > for any errors or omissions. > ********************************************************************** > >