/// <summary> /// <see cref="IClient.Stop"/> /// </summary> private void Stop() { if (this.uworker != null) { this.uworker.Recive -= this.OnRecived; this.uworker.Timeout -= this.OnTimeout; this.uworker.StopWorking(); this.uworker = null; } }
public void StopAsyncRecive() { if (this.uworker != null) { //Stops the worker threads. this.uworker.Recive -= this.OnRecived; this.uworker.Timeout -= this.OnTimeout; this.uworker.StopWorking(); this.uworker = null; } }
/// <summary> /// <see cref="IClient.Start"/> /// </summary> private void Start() { if (uworker != null) return; //We are already receiving. //Creates new workers and threads using them. this.uworker = new UdpWorker(this.connection); uworker.Recive += this.OnRecived; uworker.Timeout += this.OnTimeout; new Thread(uworker.DoWork).Start(); }
public void StartAsyncRecive() { if (uworker != null) return; //We are already receiving. //New worker objects are created and started. this.uworker = new UdpWorker(this); uworker.Recive += this.OnRecived; uworker.Timeout += this.OnTimeout; new Thread(uworker.DoWork).Start(); }