- added HTTP timeouts

git-svn-id: https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk@1085324 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/DotCMIS/binding/http.cs b/DotCMIS/binding/http.cs
index dc3379e..412b022 100644
--- a/DotCMIS/binding/http.cs
+++ b/DotCMIS/binding/http.cs
@@ -74,6 +74,19 @@
                 conn.Method = method;

                 conn.UserAgent = "Apache Chemistry DotCMIS";

 

+                // timeouts

+                int connectTimeout = session.GetValue(SessionParameter.ConnectTimeout, -2);

+                if (connectTimeout >= -1)

+                {

+                    conn.Timeout = connectTimeout;

+                }

+

+                int readTimeout = session.GetValue(SessionParameter.ReadTimeout, -2);

+                if (readTimeout >= -1)

+                {

+                    conn.ReadWriteTimeout = readTimeout;

+                }

+

                 // set content type

                 if (contentType != null)

                 {

diff --git a/DotCMIS/const.cs b/DotCMIS/const.cs
index c9e3a7d..1ee822d 100644
--- a/DotCMIS/const.cs
+++ b/DotCMIS/const.cs
@@ -47,10 +47,10 @@
         public const string WebServicesAclService = "org.apache.chemistry.dotcmis.binding.webservices.ACLService";

 

         public const string WebServicesWCFBinding = "org.apache.chemistry.dotcmis.binding.webservices.wcfbinding";

-        public const string WebServicesOpenTimeout = "org.apache.chemistry.dotcmis.binding.webservices.openTimeout";

-        public const string WebServicesCloseTimeout = "org.apache.chemistry.dotcmis.binding.webservices.closeTimeout";

-        public const string WebServicesSendTimeout = "org.apache.chemistry.dotcmis.binding.webservices.sendTimeout";

-        public const string WebServicesReceiveTimeout = "org.apache.chemistry.dotcmis.binding.webservices.receiveTimeout";

+        public const string WebServicesOpenTimeout = "org.apache.chemistry.dotcmis.binding.webservices.opentimeout";

+        public const string WebServicesCloseTimeout = "org.apache.chemistry.dotcmis.binding.webservices.closetimeout";

+        public const string WebServicesSendTimeout = "org.apache.chemistry.dotcmis.binding.webservices.sendtimeout";

+        public const string WebServicesReceiveTimeout = "org.apache.chemistry.dotcmis.binding.webservices.receivetimeout";

 

         public const string WebServicesEnableUnsecuredResponse = "org.apache.chemistry.dotcmis.binding.webservices.enableUnsecuredResponse"; // requires hotfix 971493 or the .NET framework 4 

 

@@ -60,6 +60,10 @@
         // compression flag

         public const string Compression = "org.apache.chemistry.dotcmis.binding.compression";

 

+        // timeouts

+        public const string ConnectTimeout = "org.apache.chemistry.dotcmis.binding.connecttimeout";

+        public const string ReadTimeout = "org.apache.chemistry.dotcmis.binding.readtimeout";

+

         // binding caches

         public const string CacheSizeRepositories = "org.apache.chemistry.dotcmis.binding.cache.repositories.size";

         public const string CacheSizeTypes = "org.apache.chemistry.dotcmis.binding.cache.types.size";