public void OnBegin(Begin begin) { lock (this.SyncRoot) { // Can happen in pipeline mode uint alreadySent = this.Session.settings.OutgoingWindow.Value - this.outgoingWindow; if (alreadySent > begin.IncomingWindow.Value) { this.outgoingWindow = 0; } else { this.outgoingWindow = begin.IncomingWindow.Value - alreadySent; } this.Session.settings.OutgoingWindow = this.outgoingWindow; } }
Error Negotiate(Begin begin) { this.outgoingChannel.OnBegin(begin); this.UpdateHandleTable(begin); return null; }
void OnReceiveBegin(Begin begin) { StateTransition stateTransition = this.TransitState("R:BEGIN", StateTransition.ReceiveOpen); this.incomingChannel.OnBegin(begin); if (stateTransition.To == AmqpObjectState.OpenReceived) { this.outgoingChannel.OnBegin(begin); this.UpdateHandleTable(begin); this.Open(); } else { Exception exception = null; Error error = this.Negotiate(begin); if (error != null) { exception = new AmqpException(error); } this.CompleteOpen(false, exception); if (exception != null) { this.SafeClose(exception); } } }
void UpdateHandleTable(Begin begin) { this.settings.HandleMax = Math.Min(this.settings.HandleMax(), begin.HandleMax()); this.linksByLocalHandle.SetMaxHandle(this.settings.HandleMax.Value); this.linksByRemoteHandle.SetMaxHandle(this.settings.HandleMax.Value); }
public void OnBegin(Begin begin) { lock (this.SyncRoot) { this.nextIncomingId = begin.NextOutgoingId.Value; } }