private void EchoServer_ReceivedPacket(object sender, ReceivedUdpPacketEventArgs e)
        {
            Console.WriteLine("UdpDemoServer::EchoServer_ReceivedPacket: received: " + e.Size + "bytes from " + e.RemoteIpEndPoint);
            UdpSocket echoServer = sender as UdpSocket;

            if (echoServer != null)
            {
                echoServer.Send(new byte[20], e.RemoteIpEndPoint);
            }
            _received = true;
        }
        private void SocketOnReceivedPacket(object sender, ReceivedUdpPacketEventArgs eventArgs)
        {
            Message message = _serializer.Deserialize(eventArgs.Received);

            HandleMessage(eventArgs.RemoteIpEndPoint, message);
        }
Exemple #3
0
 private void Client_ReceivedPacket(object sender, ReceivedUdpPacketEventArgs e)
 {
     Console.WriteLine("UdpDemo::EchoServer_ReceivedPacket: received: " + e.Size + "bytes from " + e.RemoteIpEndPoint);
     _received = true;
 }