Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ControlClient: Retry the request in case of timeout

The Helper.GetResponse method will retry once if we get a "Gateway
Timeout" HTTP response code.

Also add some additional log output for some error cases.
  • Loading branch information...
commit 27beaafdb282c0721a8350825b1164b8d45119cb 1 parent 9988b56
@bl8 bl8 authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/ControlClient.cs
View
7 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/ControlClient.cs
@@ -75,12 +75,13 @@ public ControlClient (string serviceType, Uri url, XmlDeserializer deserializer)
HttpWebResponse response;
WebException exception;
try {
- response = (HttpWebResponse)request.GetResponse ();
+ response = Helper.GetResponse (request);
exception = null;
} catch (WebException e) {
response = e.Response as HttpWebResponse;
if (response == null) {
- // TODO check for timeout
+ Log.Error (string.Format (
+ "The request for the {0} action request on {1} failed.", actionName, url));
throw new UpnpControlException (UpnpError.Unknown(), "The invokation failed.", e);
}
exception = e;
@@ -137,6 +138,8 @@ public ControlClient (string serviceType, Uri url, XmlDeserializer deserializer)
"The invokation failed but the service did not provide valid fault information " +
"(unable to deserialize a UPnPError from the SOAP envelope).", exception);
}
+ Log.Error (string.Format (
+ "The invokation for the {0} action request on {1} failed: {2}", actionName, url, envelope.Body.Value.Detail.Value));
throw new UpnpControlException (envelope.Body.Value.Detail.Value,
"The invokation failed.", exception);
}
Please sign in to comment.
Something went wrong with that request. Please try again.