示例#1
0
 void ICommunicationObject.Close(TimeSpan timeout)
 {
     if (State == CommunicationState.Opened)
     {
         InnerChannel.Close(timeout);
     }
 }
示例#2
0
 void ICommunicationObject.Close()
 {
     if (State == CommunicationState.Opened)
     {
         InnerChannel.Close();
     }
 }
 public void Close(TimeSpan timeout)
 {
     WcfClientEventSource.Log.ChannelCalled(GetType().FullName, nameof(Close));
     try
     {
         InnerChannel.Close(timeout);
     } finally
     {
         Dispose(true);
     }
 }
示例#4
0
        void ICommunicationObject.Close(TimeSpan timeout)
        {
            using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? ServiceModelActivity.CreateBoundedActivity() : null)
            {
                if (DiagnosticUtility.ShouldUseActivity)
                {
                    ServiceModelActivity.Start(activity, SR.Format(SR.ActivityCloseClientBase, typeof(TChannel).FullName), ActivityType.Close);
                }

                TimeoutHelper timeoutHelper = new TimeoutHelper(timeout);
                if (_channel != null)
                {
                    InnerChannel.Close(timeoutHelper.RemainingTime());
                }

                if (!_channelFactoryRefReleased)
                {
                    lock (s_staticLock)
                    {
                        if (!_channelFactoryRefReleased)
                        {
                            if (_channelFactoryRef.Release())
                            {
                                _releasedLastRef = true;
                            }

                            _channelFactoryRefReleased = true;
                        }
                    }

                    // Close the factory outside of the lock so that we can abort from a different thread.
                    if (_releasedLastRef)
                    {
                        if (_useCachedFactory)
                        {
                            _channelFactoryRef.Abort();
                        }
                        else
                        {
                            _channelFactoryRef.Close(timeoutHelper.RemainingTime());
                        }
                    }
                }
            }
        }
示例#5
0
        void ICommunicationObject.Close(TimeSpan timeout)
        {
            using (ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? ServiceModelActivity.CreateBoundedActivity() : null)
            {
                if (DiagnosticUtility.ShouldUseActivity)
                {
                    ServiceModelActivity.Start(activity, SR.Format(SR.ActivityCloseClientBase, typeof(TChannel).FullName), ActivityType.Close);
                }
                TimeoutHelper timeoutHelper = new TimeoutHelper(timeout);

                if (_channel != null)
                {
                    InnerChannel.Close(timeoutHelper.RemainingTime());
                }

                ChannelFactory.Close(timeoutHelper.RemainingTime());
            }
        }
示例#6
0
文件: ClientBase.cs 项目: mdae/MonoRT
 void ICommunicationObject.Close(TimeSpan timeout)
 {
     InnerChannel.Close(timeout);
 }
示例#7
0
文件: ClientBase.cs 项目: mdae/MonoRT
 public void Close()
 {
     InnerChannel.Close();
 }
示例#8
0
 public void Close(TimeSpan timeout)
 {
     InnerChannel.Close(timeout);
 }
 void ICommunicationObject.Close()
 {
     InnerChannel.Close();
 }