// called if error on socket or whilst parsing, or if user code cancels request input public void OnError(Exception e) { if (tail == null) { socket.End(); } else { // dispose all pending responses, last of which should end the socket tail.Dispose(); } }
public void Dispose() { _segment?.Dispose(); _segment = null !; }