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); }
public void BroadcastTo(Packet packet) { Sock.BeginSendTo(packet, 0, packet.Size, SocketFlags.None, SocketSettings.BroadcastEndPoint, (ar) => { }, null); }