Esempio n. 1
0
        /// <summary>
        /// Event handler for session frame.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">The event args.</param>
        private void OnSessionFrame(object sender, ControlFrameEventArgs e)
        {
            switch (e.Frame.Type)
            {
            case FrameType.SynStream:
                OpenStream(e.Frame.StreamId, e.Frame.Headers, false);
                break;

            case FrameType.SynReply:
                SMStream stream = this.GetStreamById(e.Frame.StreamId);
                if (stream != null && stream.State != SMStreamState.Closed && stream.State != SMStreamState.HalfClosed)
                {
                    stream.State = SMStreamState.Accepted;
                }
                break;

            case FrameType.CreditUpdate:
                CurrentCreditBalanceToServer += Convert.ToInt32(e.Frame.Headers["credit-addition"]);
                break;
            }
        }
 /// <summary>
 /// Event handler for session frame.
 /// </summary>
 /// <param name="sender">Sender object.</param>
 /// <param name="e">The event args.</param>
 private void OnSessionFrame(object sender, ControlFrameEventArgs e)
 {
     if (e.Frame.Type == FrameType.SynStream)
     {
         OpenStream(e.Frame.StreamId, e.Frame.Headers, false);
     }
     else if (e.Frame.Type == FrameType.SynReply)
     {
         SMStream stream = this.GetStreamById(e.Frame.StreamId);
         if (stream != null && stream.State != SMStreamState.Closed && stream.State != SMStreamState.HalfClosed)
         {
             stream.State = SMStreamState.Accepted;
         }
     }
 }