Exemplo n.º 1
0
 public void SendDataTo(Packet packet, Action success = null, Action error = null)
 {
     Sock.BeginSendTo(packet, 0, packet.Size, SocketFlags.None, SocketSettings.ToEndPoint, (ar) =>
     {
         if (ar.IsCompleted)
         {
             success?.Invoke();
         }
         else
         {
             error?.Invoke();
         }
     }, null);
 }
Exemplo n.º 2
0
 public void BroadcastTo(Packet packet)
 {
     Sock.BeginSendTo(packet, 0, packet.Size, SocketFlags.None, SocketSettings.BroadcastEndPoint, (ar) => { }, null);
 }