public override void Start() { try { if (Listener?.Running == true) { return; } Listener = new UdpListener(this); Listener.Start(); if (OnStarted != null) { Task.Run(() => OnStarted(new NetClientEventArgs <IUdpConnection>(this))); } } catch (Exception ex) { if (OnException != null) { Task.Run(() => OnException(new NetClientEventArgs <IUdpConnection>(this) { Exception = ex })); } } }
public override void Start() { try { if (Listener?.Running == true) { return; } Listener = new UdpListener(this); Listener.Start(); OnStarted?.Invoke(new NetClientEventArgs <IUdpConnection>(this)); } catch (Exception ex) { OnException?.Invoke(new NetClientEventArgs <IUdpConnection>(this) { Exception = ex }); } }