You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by Lars Gramark <la...@stickybit.se> on 2009/09/08 15:39:21 UTC
XmlRpcSunHttpTransport and read timeout
The reply timeout set in the XmlRpcHttpClientConfig is ignored when making synchronous calls from the client.
This may cause calls to hang forever if there is no response.
Digging into the code, I noticed that the read timeout provided by the XmlRpcHttpClientConfig
is ignored when creating a URLConnection from the
XmlRpcSunHttpTransport. The method URLConnection.setReadTimeout, made available in Java 1.5, could be used to solve this.
Is this a bug or is it a deliberate choice you've made to keep Java 1.4 compatibility?
Thanks
Lars Gråmark
Re: XmlRpcSunHttpTransport and read timeout
Posted by Gam <ga...@fastmail.fm>.
Thanks Jochen.
Interesting way of doing it. I was expecting complex class loader
gymnastic!
Regards,
Gam.
On 11 sept. 09, at 20:43, Jochen Wiedmann wrote:
> On Fri, Sep 11, 2009 at 6:46 AM, Gam <ga...@fastmail.fm> wrote:
>
>> I see that this class is specifically for Java 1.5. Do you know
>> were is the
>> code that selects the correct class at runtime? I'm very interested
>> to know
>> how it work.
>
> See
>
> https://svn.apache.org/viewvc/webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcClientDefaults.java?view=markup
>
>
> --
> Germanys national anthem is the most boring in the world - how
> telling!
Re: XmlRpcSunHttpTransport and read timeout
Posted by Jochen Wiedmann <jo...@gmail.com>.
On Fri, Sep 11, 2009 at 6:46 AM, Gam <ga...@fastmail.fm> wrote:
> I see that this class is specifically for Java 1.5. Do you know were is the
> code that selects the correct class at runtime? I'm very interested to know
> how it work.
See
https://svn.apache.org/viewvc/webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcClientDefaults.java?view=markup
--
Germanys national anthem is the most boring in the world - how telling!
Re: XmlRpcSunHttpTransport and read timeout
Posted by Gam <ga...@fastmail.fm>.
Hello Jochen,
I see that this class is specifically for Java 1.5. Do you know were
is the code that selects the correct class at runtime? I'm very
interested to know how it work.
Regards,
Gam.
On 9 sept. 09, at 16:58, Jochen Wiedmann wrote:
> Try adding the following method to the XmlRpcSun15HttpTransport and
> let me know, whether that works.
>
> Jochen
>
> protected void initHttpHeaders(XmlRpcRequest pRequest)
> throws XmlRpcClientException {
> final XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig)
> pRequest.getConfig();
> int connectionTimeout = config.getConnectionTimeout();
> if (connectionTimeout > 0) {
> getURLConnection().setConnectTimeout(connectionTimeout);
> }
> int replyTimeout = config.getReplyTimeout();
> if (replyTimeout > 0) {
> getURLConnection().setReadTimeout(replyTimeout);
> }
> super.initHttpHeaders(pRequest);
> }
>
>
>
> --
> Germanys national anthem is the most boring in the world - how
> telling!
Re: XmlRpcSunHttpTransport and read timeout
Posted by Jochen Wiedmann <jo...@gmail.com>.
Try adding the following method to the XmlRpcSun15HttpTransport and
let me know, whether that works.
Jochen
protected void initHttpHeaders(XmlRpcRequest pRequest)
throws XmlRpcClientException {
final XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig)
pRequest.getConfig();
int connectionTimeout = config.getConnectionTimeout();
if (connectionTimeout > 0) {
getURLConnection().setConnectTimeout(connectionTimeout);
}
int replyTimeout = config.getReplyTimeout();
if (replyTimeout > 0) {
getURLConnection().setReadTimeout(replyTimeout);
}
super.initHttpHeaders(pRequest);
}
--
Germanys national anthem is the most boring in the world - how telling!
Re: XmlRpcSunHttpTransport and read timeout
Posted by Gam <ga...@fastmail.fm>.
Hello,
I did rose the issue in feb 2008, providing a fix for this, see here:
http://marc.info/?l=xmlrpc-dev&m=120318156313794&w=2
but my problem was how to make sure we are not on 1.4?
Regards,
Gam.
On 8 sept. 09, at 21:51, Jochen Wiedmann wrote:
> You're the first one to point this out. Compatibility to 1.4 is not a
> problem, because we already have JDK specific variants of the
> transports. Wanna provide a patch?
>
>
> On Tue, Sep 8, 2009 at 3:39 PM, Lars Gramark<la...@stickybit.se> wrote:
>> The reply timeout set in the XmlRpcHttpClientConfig is ignored when
>> making synchronous calls from the client.
>> This may cause calls to hang forever if there is no response.
>>
>> Digging into the code, I noticed that the read timeout provided by
>> the XmlRpcHttpClientConfig
>> is ignored when creating a URLConnection from the
>> XmlRpcSunHttpTransport. The method URLConnection.setReadTimeout,
>> made available in Java 1.5, could be used to solve this.
>> Is this a bug or is it a deliberate choice you've made to keep Java
>> 1.4 compatibility?
>>
>> Thanks
>> Lars Gråmark
>>
>>
>
>
>
> --
> Germanys national anthem is the most boring in the world - how
> telling!
RE: XmlRpcSunHttpTransport and read timeout
Posted by Lars Gramark <la...@stickybit.se>.
Sure. I'll be happy to provide a patch. I'll get back to you.
----- Original Message -----
From: Jochen Wiedmann <jo...@gmail.com>
Sent: Tue, 2009/9/8 15:51
To: xmlrpc-dev@ws.apache.org
Subject: Re: XmlRpcSunHttpTransport and read timeout
You're the first one to point this out. Compatibility to 1.4 is not a
problem, because we already have JDK specific variants of the
transports. Wanna provide a patch?
On Tue, Sep 8, 2009 at 3:39 PM, Lars Gramark<la...@stickybit.se> wrote:
> The reply timeout set in the XmlRpcHttpClientConfig is ignored when making synchronous calls from the client.
> This may cause calls to hang forever if there is no response.
>
> Digging into the code, I noticed that the read timeout provided by the XmlRpcHttpClientConfig
> is ignored when creating a URLConnection from the
> XmlRpcSunHttpTransport. The method URLConnection.setReadTimeout, made available in Java 1.5, could be used to solve this.
> Is this a bug or is it a deliberate choice you've made to keep Java 1.4 compatibility?
>
> Thanks
> Lars Gråmark
>
>
--
Germanys national anthem is the most boring in the world - how telling!
Re: XmlRpcSunHttpTransport and read timeout
Posted by Jochen Wiedmann <jo...@gmail.com>.
You're the first one to point this out. Compatibility to 1.4 is not a
problem, because we already have JDK specific variants of the
transports. Wanna provide a patch?
On Tue, Sep 8, 2009 at 3:39 PM, Lars Gramark<la...@stickybit.se> wrote:
> The reply timeout set in the XmlRpcHttpClientConfig is ignored when making synchronous calls from the client.
> This may cause calls to hang forever if there is no response.
>
> Digging into the code, I noticed that the read timeout provided by the XmlRpcHttpClientConfig
> is ignored when creating a URLConnection from the
> XmlRpcSunHttpTransport. The method URLConnection.setReadTimeout, made available in Java 1.5, could be used to solve this.
> Is this a bug or is it a deliberate choice you've made to keep Java 1.4 compatibility?
>
> Thanks
> Lars Gråmark
>
>
--
Germanys national anthem is the most boring in the world - how telling!