/// <summary> /// Initializes a new instance of the Forwarder class. /// </summary> /// <param name="a">The stream for one connection.</param> /// <param name="b">The stream for the other connection.</param> /// <param name="closeHandler"> /// An optional close callback handler. /// </param> public Forwarder(Stream a, Stream b, ForwarderCloseHandler closeHandler, DiagnosticsHelper webRoleDiagnostics) { if (null == webRoleDiagnostics) { this.wd = new StandaloneDiagnosticHost(); } else { this.wd = webRoleDiagnostics; } #region ENTER using (AutoEnterExitTrace aeet = new AutoEnterExitTrace(wd, wd.WebTrace, "Forwarder_ctor()")) { #endregion ENTER this.streams = new Stream[2] { a, b }; this.closeHandler = closeHandler; this.halfOpen = false; this.closing = 0; this.directions = new PerDirection[2]; this.directions[0] = new PerDirection(this, a, b, this.wd); this.directions[1] = new PerDirection(this, b, a, this.wd); #region LEAVE } #endregion LEAVE }
/// <summary> /// Initializes a new instance of the Forwarder class. /// </summary> /// <param name="a">The stream for one connection.</param> /// <param name="b">The stream for the other connection.</param> /// <param name="closeHandler"> /// An optional close callback handler. /// </param> public Forwarder(Stream a, Stream b, ForwarderCloseHandler closeHandler, DiagnosticsHelper webRoleDiagnostics) { if (null == webRoleDiagnostics) this.wd = new StandaloneDiagnosticHost(); else this.wd = webRoleDiagnostics; #region ENTER using (AutoEnterExitTrace aeet = new AutoEnterExitTrace(wd, wd.WebTrace, "Forwarder_ctor()")) { #endregion ENTER this.streams = new Stream[2] { a, b }; this.closeHandler = closeHandler; this.halfOpen = false; this.closing = 0; this.directions = new PerDirection[2]; this.directions[0] = new PerDirection(this, a, b, this.wd); this.directions[1] = new PerDirection(this, b, a, this.wd); #region LEAVE } #endregion LEAVE }