Esempio n. 1
0
        internal async Task <NetworkPacket> ConnectAndWaitResponse(string address, string port, NetworkPacket packet)
        {
            try
            {
                byte[] data     = _serializer.CreateMessageFromPacket(packet);
                byte[] response = await _networkConnection.ConnectAndWaitResponse(address, port, data);

                return(_serializer.ConstructPacketFromMessage(response));
            }
            catch { }
            return(new AcknowledgePacket());
        }
Esempio n. 2
0
 public void udpHandler(DatagramSocket socket, NetworkPacket packet)
 {
     _rootPage.NotifyUserFromAsyncThread("Packet server received via UDP: " + packet.Type);
 }