Exemplo n.º 1
0
        protected override void SendPacket(Packet.Packet packet)
        {
            if (!UdpClient.Client.Connected)
            {
                return;
            }

            UdpClient.BeginSend(packet.ToArray(), packet.Length(), _endPoint, null, null);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 /**
  * 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);
 }