/// <summary> /// Initializes a new instance of <see cref="CryptoConnection"/> and sets the logger and flags to the specified values, /// <para/> /// This constructor will also call <see cref="CryptoConnection.WrapSocket(Socket)"/> with the specified <see cref="Socket"/> /// </summary> /// <param name="logger"></param> /// <param name="s"></param> /// <param name="flags"></param> public CryptoConnection(ILogger logger, Socket s, CryptoConnectionFlags flags) { this.Init(logger); this.setupFlags = flags; if (s == null) { throw new ArgumentNullException("s"); } this.WrapSocket(s); }
/// <summary> /// Removes the specified flag from the <see cref="CryptoConnectionFlags"/> (<see cref="CryptoConnection.ConnectionFlags"/>) of this instance /// </summary> /// <param name="flag"></param> public void UnSetFlag(CryptoConnectionFlags flag) { this.ConnectionFlags = (this.ConnectionFlags | flag) ^ flag; }
/// <summary> /// Initializes a new instance of <see cref="CryptoConnection"/> and sets the logger and connectionflags to the specified values /// </summary> /// <param name="logger">The logger to use for logging</param> /// <param name="flags">The <see cref="CryptoConnectionFlags"/> butmask to set</param> public CryptoConnection(ILogger logger, CryptoConnectionFlags flags) { this.Init(logger); this.setupFlags = flags; }
/// <summary> /// Adds the specified flag to the <see cref="CryptoConnectionFlags"/> (<see cref="CryptoConnection.ConnectionFlags"/>) of this instance /// </summary> /// <param name="flag"></param> public void SetFlag(CryptoConnectionFlags flag) { this.ConnectionFlags |= flag; }