[System.ServiceModel] Fix timeout defaulting to 0 seconds
authorAlexander Kyte <alexander.kyte@xamarin.com>
Tue, 24 Mar 2015 21:50:14 +0000 (17:50 -0400)
committerAlexander Kyte <alexander.kyte@xamarin.com>
Wed, 13 May 2015 17:54:53 +0000 (13:54 -0400)
mcs/class/System.ServiceModel/System.ServiceModel.Description/MetadataExchangeClient.cs
mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs

index 7d652098c94da7ee6c2b3e6cace9b5cc9f676988..a429fb9e4ae2773e3bec55d18f5f5a9992a1fa1f 100644 (file)
@@ -53,6 +53,7 @@ namespace System.ServiceModel.Description
                EndpointAddress address;
                SMBinding binding;
                MetadataExchangeClientMode mode = MetadataExchangeClientMode.MetadataExchange;
+               TimeSpan? operation_timeout = null;
 
                // constructors
 
@@ -88,7 +89,17 @@ namespace System.ServiceModel.Description
                [MonoTODO]
                public int MaximumResolvedReferences { get; set; }
 
-               public TimeSpan OperationTimeout { get; set; }
+               public TimeSpan OperationTimeout {
+                       get {
+                               if (!this.operation_timeout.HasValue) {
+                                       this.operation_timeout = DefaultCommunicationTimeouts.Instance.ReceiveTimeout;
+                               }
+                               return this.operation_timeout.Value;
+                       }
+                       set {
+                               this.operation_timeout = value;
+                       }
+               }
 
                [MonoTODO]
                public bool ResolveMetadataReferences { get; set; }
index 043b2ab7af08df3875689382a09e41e1210750f3..2e2b0d60b0860a432a7a5229b0f1e409a0ab9af2 100644 (file)
@@ -67,6 +67,8 @@ namespace System.ServiceModel.MonoInternal
                TimeSpan default_open_timeout, default_close_timeout;
                IChannel channel;
                IChannelFactory factory;
+               TimeSpan? operation_timeout = null;
+
 
                #region delegates
                readonly ProcessDelegate _processDelegate;
@@ -108,7 +110,6 @@ namespace System.ServiceModel.MonoInternal
 
                        // default values
                        AllowInitializationUI = true;
-                       OperationTimeout = TimeSpan.FromMinutes (1);
 
                        if (contextChannel != null)
                                channel = contextChannel;
@@ -322,8 +323,17 @@ namespace System.ServiceModel.MonoInternal
                        }
                }
 
-               [MonoTODO]
-               public TimeSpan OperationTimeout { get; set; }
+               public TimeSpan OperationTimeout {
+                       get {
+                               if (!this.operation_timeout.HasValue) {
+                                       this.operation_timeout = DefaultCommunicationTimeouts.Instance.ReceiveTimeout;
+                               }
+                               return this.operation_timeout.Value;
+                       }
+                       set {
+                               this.operation_timeout = value;
+                       }
+               }
 
                public IOutputSession OutputSession {
                        get {