ClearCanvas.Dicom.Network.NetworkBase.ShutdownNetworkThread C# (CSharp) Method

ShutdownNetworkThread() protected method

Method for shutting down the network thread. Should only be called from the CloseNetwork() routine.
protected ShutdownNetworkThread ( int millisecondsTimeout ) : void
millisecondsTimeout int
return void
        protected void ShutdownNetworkThread(int millisecondsTimeout)
        {
            _stop = true;
            if (_readThread != null)
            {
                if (!Thread.CurrentThread.Equals(_readThread))
                {
                    _readThread.Join(millisecondsTimeout);
                    _readThread = null;
                }
            }

            if (_writeThread != null)
            {
                _pduQueue.ContinueBlocking = false;

                if (!Thread.CurrentThread.Equals(_writeThread))
                {
                    _writeThread.Join(millisecondsTimeout);
                    _writeThread = null;
                }
            }

            if (_processThread!=null)
            {
                _processingQueue.ContinueBlocking = false;

                if (!Thread.CurrentThread.Equals(_processThread))
                {
                    _processThread.Join(millisecondsTimeout);
                    _processThread = null;
                }
            }
        }