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()); }
public void udpHandler(DatagramSocket socket, NetworkPacket packet) { _rootPage.NotifyUserFromAsyncThread("Packet server received via UDP: " + packet.Type); }