[System.ServiceModel] Don't use DateTime.Now for measuring elapsed time
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel / ClientRuntimeChannel.cs
index 36ea57b5b9fd7b6170cc447d46b2da4cc1f19b26..df7a9e4cd9742a07869d9f9be7ada306ca16312e 100644 (file)
@@ -383,7 +383,6 @@ namespace System.ServiceModel.MonoInternal
 
                protected override void OnClose (TimeSpan timeout)
                {
-                       DateTime start = DateTime.Now;
                        if (channel.State == CommunicationState.Opened)
                                channel.Close (timeout);
                }
@@ -593,9 +592,9 @@ namespace System.ServiceModel.MonoInternal
                        // FIXME: implement ConcurrencyMode check:
                        // if it is .Single && this instance for a callback channel && the operation is invoked inside service operation, then error.
 
-                       DateTime startTime = DateTime.Now;
+                       DateTime startTime = DateTime.UtcNow;
                        OutputChannel.Send (msg, timeout);
-                       return ((IDuplexChannel) channel).Receive (timeout - (DateTime.Now - startTime));
+                       return ((IDuplexChannel) channel).Receive (timeout - (DateTime.UtcNow - startTime));
                }
 
                internal IAsyncResult BeginRequest (Message msg, TimeSpan timeout, AsyncCallback callback, object state)