Ejemplo n.º 1
0
            public void Dispose()
            {
                if (!disposed)
                {
                    DisposeUtils.DisposeSafely(ref eventArgs);

                    disposed = true;
                }
            }
Ejemplo n.º 2
0
        /// <inheritdoc/>
        public void Dispose()
        {
            if (!disposed)
            {
                DisposeUtils.DisposeSafely(ref socket);
                DisposeUtils.DisposeSafely(ref acceptEventArgs);

                CloseClientsSafely();

                DisposeUtils.DisposeSafely(ref eventArgsManager);

                disposed = true;
            }
        }
Ejemplo n.º 3
0
        private void Abort(Exception exception = null)
        {
            if (exception != null)
            {
                RaiseException(exception);
            }

            aborted = true;

            upstream?.Abort();
            downstream?.Abort();

            DisposeUtils.DisposeSafely(ref source);
            DisposeUtils.DisposeSafely(ref target);
        }
Ejemplo n.º 4
0
        public void Dispose()
        {
            if (!disposed)
            {
                if (!aborted)
                {
                    source?.Shutdown(SocketShutdown.Both);
                    target?.Shutdown(SocketShutdown.Both);
                }

                DisposeUtils.DisposeSafely(ref source);
                DisposeUtils.DisposeSafely(ref target);
                DisposeUtils.DisposeSafely(ref upstream);
                DisposeUtils.DisposeSafely(ref downstream);

                disposed = true;
            }
        }
Ejemplo n.º 5
0
        public void Dispose()
        {
            if (!disposed)
            {
                lock (syncRoot)
                {
                    foreach (var eventArgs in pool)
                    {
                        eventArgs.Send.Dispose();
                        eventArgs.Receive.Dispose();
                    }
                    pool.Clear();

                    DisposeUtils.DisposeSafely(ref bufferManager);
                }

                disposed = true;
            }
        }