Beispiel #1
0
        /// <inheritdoc />
        public void Dispose()
        {
            if (!_isDisposed)
            {
                Misc.AssignNullAndDispose(ref _l);

                _isDisposed = true;
            }
        }
        /// <summary>
        /// Virtual dispose method. When overriding, call the base implementation before your logic.
        /// </summary>
        /// <param name="disposing">
        /// A parameter to denote whether the method is being called during Disposal or Finalization.
        /// </param>
        private void Dispose(bool disposing)
        {
            if (!_isDisposed && disposing)
            {
                Misc.AssignNullAndDispose(ref _stream);

                _isDisposed = true;
            }
        }
Beispiel #3
0
        /// <summary>
        /// Called when the instance is being released.
        /// </summary>
        /// <param name="disposing">Whether we are disposing or finalizing the instance.</param>
        protected virtual void Dispose(bool disposing)
        {
            Close();

            if (disposing && !_isDisposed)
            {
                Misc.AssignNullAndDispose(ref _socketArgs);

                _isDisposed = true;
            }
        }
        /// <summary>
        /// Runs the disposal operations for the base class.
        /// </summary>
        /// <param name="disposing">Whether the method is being called for disposal or finalization.</param>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing && !_isDisposed)
            {
                Misc.AssignNullAndDispose(ref _baseSession);
                Misc.AssignNullAndDispose(ref _headerBuffer);
                Misc.AssignNullAndDispose(ref _packetBuffer);

                _isDisposed = true;
            }
        }
Beispiel #5
0
        /// <inheritdoc />
        public void Dispose()
        {
            if (!_isDisposed)
            {
                Misc.AssignNullAndDispose(ref _accountSession);

                _keepAliveTimer.Close();

                ServerSession.Close("Client disposed.");

                _isDisposed = true;
            }
        }
Beispiel #6
0
 /// <inheritdoc />
 public void Dispose()
 {
     Misc.AssignNullAndDispose(ref _socket);
     Misc.AssignNullAndDispose(ref _sendDescriptor);
     Misc.AssignNullAndDispose(ref _receiveDescriptor);
 }
Beispiel #7
0
 public void TearDown()
 {
     Misc.AssignNullAndDispose(ref _builder);
 }