예제 #1
0
 protected override void Closed(Channel channel, ChannelCloseEventArgs e)
 {
     Assert.IsTrue(e.WasClean);
     Assert.IsFalse(e.WasDenied);
     
     if (channel == emitListener) {
         Done();
     }
 }
예제 #2
0
     protected override void Closed(Channel channel, ChannelCloseEventArgs e)
     {
         if (channel == deny) {
             Assert.IsTrue(e.WasDenied);
             Assert.IsFalse(e.WasClean);
 			Assert.AreEqual(e.Text, "DENIED");
         }
         else {
             Assert.IsTrue(e.WasClean);
             Assert.IsFalse(e.WasDenied);
         }
         
         Done();
     }
예제 #3
0
 protected override void Closed(Channel channel, ChannelCloseEventArgs e)
 {
     Assert.IsTrue(e.WasClean);
     Assert.IsFalse(e.WasDenied);
     Done();
 }
예제 #4
0
 static void c_Closed(object sender, ChannelCloseEventArgs e)
 {
     Console.WriteLine("Channel is now closed, bye..");
     channel = null;
 }
예제 #5
0
파일: Channel.cs 프로젝트: hydna/Hydna.NET
        internal void handleClose(Frame frame, string reason)
        {
            if (_state == ChannelState.Closed) {
                return;
            }

            _state = ChannelState.Closed;
            _ptr = 0;

            if (_closedInvoker == null)
                return;

            ChannelCloseEventArgs e;

            if (frame == null) {
                e = new ChannelCloseEventArgs(false, false, reason);
            }
            else {
                bool wasDenied = frame.OpCode == OpCode.Open;
                bool wasClean = wasDenied ? false
                                          : frame.SignalFlag == SignalFlag.End;

                e = new ChannelCloseEventArgs(frame.ContentType,
                                              frame.Payload,
                                              wasDenied,
                                              wasClean,
                                              reason);
            }

            _closedInvoker(this, e);
        }
예제 #6
0
파일: BaseTest.cs 프로젝트: hydna/Hydna.NET
 protected virtual void Closed(Channel channel, ChannelCloseEventArgs e){}