示例#1
0
文件: Client.cs 项目: gustavAR/Spang
        /// <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;
            }
        }
示例#2
0
 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;
     }
 }
示例#3
0
文件: Client.cs 项目: gustavAR/Spang
        /// <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();
        }
示例#4
0
        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();
        }