예제 #1
0
 protected override void ReceiveConnect(ConnectMessage connectMessage)
 {
     if (!IgnoreConnects)
         base.ReceiveConnect(connectMessage);
 }
예제 #2
0
        public void ConnectMessageTest()
        {
            var m = new ConnectMessage();
            var d = (ConnectMessage) UdpTrackerMessage.DecodeMessage(m.Encode(), 0, m.ByteLength, MessageType.Request);
            Check(m, MessageType.Request);

            Assert.AreEqual(0, m.Action, "#0");
            Assert.AreEqual(m.Action, d.Action, "#1");
            Assert.AreEqual(m.ConnectionId, d.ConnectionId, "#2");
            Assert.AreEqual(m.TransactionId, d.TransactionId, "#3");
            Assert.IsTrue(Toolbox.ByteMatch(m.Encode(), d.Encode()), "#4");
        }