protected override void SendPacket(Packet.Packet packet) { if (!UdpClient.Client.Connected) { return; } UdpClient.BeginSend(packet.ToArray(), packet.Length(), _endPoint, null, null); }
public void Send(Packet.Packet packet) { if (UdpClient?.Client == null) { return; } if (!UdpClient.Client.Connected) { Logger.Get().Error(this, "Tried sending packet, but UDP was not connected"); return; } // Send the packet UdpClient.BeginSend(packet.ToArray(), packet.Length(), null, null); }
/** * Sends a packet over UDP to this specific client */ public void SendUdp(UdpClient udpClient, Packet.Packet packet) { udpClient.BeginSend(packet.ToArray(), packet.Length(), _endPoint, null, null); }