public void Dispose() { if (!disposed) { DisposeUtils.DisposeSafely(ref eventArgs); disposed = true; } }
/// <inheritdoc/> public void Dispose() { if (!disposed) { DisposeUtils.DisposeSafely(ref socket); DisposeUtils.DisposeSafely(ref acceptEventArgs); CloseClientsSafely(); DisposeUtils.DisposeSafely(ref eventArgsManager); disposed = true; } }
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); }
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; } }
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; } }