diff options
author | Tom Grimshaw | 2010-07-03 06:08:18 -0700 |
---|---|---|
committer | Tom Grimshaw | 2010-07-03 06:08:18 -0700 |
commit | 3d495b709ec897970b24ce48d6a8495d520864d4 (patch) | |
tree | c62d1283405e52379f98ffae630788d8e7fa27ee | |
parent | Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/ca... (diff) | |
download | opensim-SC-3d495b709ec897970b24ce48d6a8495d520864d4.zip opensim-SC-3d495b709ec897970b24ce48d6a8495d520864d4.tar.gz opensim-SC-3d495b709ec897970b24ce48d6a8495d520864d4.tar.bz2 opensim-SC-3d495b709ec897970b24ce48d6a8495d520864d4.tar.xz |
Implement a timeout value in the SynchronousRestObjectRequester. Default is 100 seconds.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs index eab463c..bb3b8b1 100644 --- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs +++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs | |||
@@ -57,6 +57,21 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
57 | /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> | 57 | /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> |
58 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) | 58 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) |
59 | { | 59 | { |
60 | return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 100); | ||
61 | } | ||
62 | /// <summary> | ||
63 | /// Perform a synchronous REST request. | ||
64 | /// </summary> | ||
65 | /// <param name="verb"></param> | ||
66 | /// <param name="requestUrl"></param> | ||
67 | /// <param name="obj"> </param> | ||
68 | /// <param name="timeout"> </param> | ||
69 | /// <returns></returns> | ||
70 | /// | ||
71 | /// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting | ||
72 | /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> | ||
73 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout) | ||
74 | { | ||
60 | Type type = typeof (TRequest); | 75 | Type type = typeof (TRequest); |
61 | TResponse deserial = default(TResponse); | 76 | TResponse deserial = default(TResponse); |
62 | 77 | ||
@@ -81,7 +96,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
81 | 96 | ||
82 | int length = (int) buffer.Length; | 97 | int length = (int) buffer.Length; |
83 | request.ContentLength = length; | 98 | request.ContentLength = length; |
84 | 99 | request.Timeout = pTimeout * 1000; | |
85 | Stream requestStream = null; | 100 | Stream requestStream = null; |
86 | try | 101 | try |
87 | { | 102 | { |