AFAIK, yes.

There is a socket connect timeout, when the socket is initially created.
And there is a socket timeout. I believe calling stub.setTimeout is
setting
the latter.

The classes are DefaultSocketFactory (HTTP) and JSSESocketFactory
(HTTPS).

When running java 1.4, as stated, the DefaultSocketFactory will create
the socket with a connect timeout if "axis.client.connect.timeout" is
set.

But the JSSESocketFactory does not seem to do the same.

dave



-----Original Message-----
From: Liu, Tao [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 28, 2005 7:49 AM
To: 'axis-user@ws.apache.org'
Subject: RE: Re: How to set an SSL socket connect timeout value?

Are there two types of timeouts discussed here? One is "Connection
Timeout"
and the other is "Socket Timeout".

The connection timeout can be set only in Java 1.4 and above, but I
don't
know how to set it in Axis 1.x since it need to support Java 1.3.

I plan to move to Axis2.

Thanks,
Tao


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 27, 2005 9:31 PM
To: axis-user@ws.apache.org
Subject: RE: Re: How to set an SSL socket connect timeout value?


Our Webservices are always SSL and we have always successfully timed out
a
socket by calling setTimeout(InMillis) on org.apache.axis.client.Stub
instance.   sample code is attached below.


            if(port instanceof org.apache.axis.client.Stub){ //
instanceof
and Class casting will always drag performance
                org.apache.axis.client.Stub stub =
(org.apache.axis.client.Stub) port;
                /**
                 * set the timeout to in MilliSeconds
                 */
                int timeOut = 10000; // 10 seconds
                stub.setTimeout(timeOut);
                return stub;
            }

Have not yet looked at the underlying code to see how it works, but then
never had the need as it has been working like a charm. The same works
fine
for non SSL socket too.


Thanks and Regards,
===
Gary Grewal

-


 

                      "David Penaskovic"

                      <[EMAIL PROTECTED]        To:
<axis-user@ws.apache.org>                                   
                      r-peak.com>               cc:

                                                Subject:  RE:  Re: How
to
set an SSL socket connect timeout value?    
                      12/27/2005 01:56

                      PM

                      Please respond to

                      axis-user

 

 





Didn't finish. Apologies.

That method below, getSocket() in HTTPSender, uses the timeout to call
setSoTimeout(). But it is already too late, the socket is already
created. I
need to set the *connect* timeout at socket creation time.

The org.apache.axis.components.net.DefaultSocketFactory (used for HTTP)
does
create a socket with a connect timeout if I've set the AXIS property
'axis.client.connect.timeout'

But the org.apache.axis.components.net.JSSESocketFactory (used for
HTTPS) does not do this.

I can't seem to figure this out for SSL.

dave



-----Original Message-----
From: David Penaskovic
Sent: Tuesday, December 27, 2005 11:50 AM
To: 'axis-user@ws.apache.org'
Subject: RE: Re: How to set an SSL socket connect timeout value?

I don't believe that will work.

In class org.apache.axis.transport.http.HTTPSender, this method:

protected void getSocket(SocketHolder sockHolder,
                         MessageContext msgContext,
                         String protocol,
                         String host, int port, int timeout,
                         StringBuffer otherHeaders,
                         BooleanHolder useFullURL)
        throws Exception
{
        Hashtable options = getOptions();
        if(timeout > 0) {
            if(options == null) {
                options = new Hashtable();
            }

options.put(DefaultSocketFactory.CONNECT_TIMEOUT,Integer.toString(timeou
t));
        }
        SocketFactory factory =
SocketFactoryFactory.getFactory(protocol, options);
        if (factory == null) {
            throw new IOException(Messages.getMessage("noSocketFactory",
protocol));
        }
        Socket sock = factory.create(host, port, otherHeaders,
useFullURL);
        if(timeout > 0) {
            sock.setSoTimeout(timeout);
        }
        sockHolder.setSocket(sock);
    }



-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Kent Tong
Sent: Sunday, December 25, 2005 8:16 AM
To: axis-user@ws.apache.org
Subject: Re: How to set an SSL socket connect timeout value?

David Penaskovic <DPenaskovic <at> silver-peak.com> writes:

> I can't figure out how to set the timeout value for an initial SSL 
> socket connect. The default varies from platform to platform and I
would
> like to set this value explicitly.

Have you tried:

  call.setTimeout(timeout);







This communication is for informational purposes only. It is not
intended as
an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market
prices, data and other information are not warranted as to completeness
or
accuracy and are subject to change without notice. Any comments or
statements made herein do not necessarily reflect those of JPMorgan
Chase &
Co., its subsidiaries and affiliates

Reply via email to