private void WaitOnPendingFlush() { lock (this.syncLock) { if (this.asyncResult == null) return; this.stream.EndWrite(this.asyncResult); this.asyncResult = null; } }