|
View:
New views
10 Messages
—
Rating Filter:
Alert me
|
|
|
XmlRpcSunHttpTransport and read timeoutThe 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 timeoutYou'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<lars@...> 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 timeoutSure. I'll be happy to provide a patch. I'll get back to you.
----- Original Message ----- From: Jochen Wiedmann <jochen.wiedmann@...> Sent: Tue, 2009/9/8 15:51 To: xmlrpc-dev@... 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<lars@...> 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 timeoutHello,
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<lars@...> 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 timeoutTry 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 timeoutOk, commited.
On Thu, Sep 10, 2009 at 12:19 PM, Lars Gramark <lars@...> wrote: > Works like a charm. I've verified reply timeout and connection timeout. -- Germanys national anthem is the most boring in the world - how telling! |
|
|
Re: XmlRpcSunHttpTransport and read timeoutHello 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 timeoutOn Fri, Sep 11, 2009 at 6:46 AM, Gam <gamaliel@...> 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 timeoutThanks 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 <gamaliel@...> 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! |
| Free embeddable forum powered by Nabble | Forum Help |