public void TestHandler(UdpContext udpContext)
 {
     hello = udpContext.GetData <Hello>();
     if (hello.HelloString == "re")
     {
         UdpServerTest.ackNums++;
     }
 }
Beispiel #2
0
 public void OnReceiveData(UdpContext udpContext)
 {
     IntegrationTest.data[peer.ID] = udpContext.GetData <string>();
     if (IntegrationTest.data[peer.ID] is "test")
     {
         Interlocked.Increment(ref IntegrationTest.nums);
     }
 }
Beispiel #3
0
        public void OnReceiveData(UdpContext udpContext)
        {
            var d = udpContext.GetData <string>();

            if (d == "test")
            {
                Program.nums++;
            }
            Console.WriteLine("peer:" + d);
        }
 public async void StreamHandShakeHandler(UdpContext context)
 {
     await peer.StreamTransferRequested(context.GetData <BasicFileInfo>());
 }
 public void MTUHandler(UdpContext udpContext)
 {
     peer.RemoteBufferLen = udpContext.GetData <int>();
 }
 public async void ConnectionRequestedHandler(UdpContext context)
 {
     _logger.LogInformation("received connection request!");
     await peer.OnConnectionRequested(context.GetData <PeerInfo>() !);
 }
 public void ConnectionRequestCallbackHandler(UdpContext context)
 {
     peer.OnConnectionCallback(context.GetData <bool>());
     _logger.LogInformation("received connection request callback!");
 }
 public void ChatMsgHandler(UdpContext udpContext)
 {
     OnChatMsgReceived?.Invoke(this, udpContext.GetData <string>());
 }