예제 #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();
 }