/// <summary>
 ///     注销网络
 /// </summary>
 /// <returns>返回注册的状态</returns>
 public override bool UnRegist()
 {
     try
     {
         if (_listener != null)
         {
             _listener.Connected -= ListenerConnected;
             _listener.Stop();
             _listener = null;
             return(true);
         }
         return(true);
     }
     catch (System.Exception ex)
     {
         _tracing.Error(ex, null);
         return(false);
     }
 }
 /// <summary>
 ///     注册网络
 /// </summary>
 /// <returns>返回注册的状态</returns>
 public override bool Regist()
 {
     try
     {
         if (_listener == null)
         {
             _listener = new BasicTcpAsynListenerV2 <BasicPortListenerInfomation>(_port);
             _listener.Start();
             if (_listener.State)
             {
                 _listener.Connected += ListenerConnected;
             }
         }
         return(_listener.State);
     }
     catch (System.Exception ex)
     {
         _tracing.Error(ex, null);
         return(false);
     }
 }