Exemple #1
0
 public void Start()
 {
     if (_active)
     {
         return;
     }
     _active = true;
     OnActiveUpdate();
     if (_mode == TcpMode.Server)
     {
         _server        = new ACTServer(_plugin);
         _server.Close += OnClose;
         _server.Start();
     }
     else if (_mode == TcpMode.Client)
     {
         _client        = new ACTClient(_plugin);
         _client.Close += OnClose;
         _client.Start();
     }
 }
Exemple #2
0
        public void Stop()
        {
            if (!_active)
            {
                return;
            }

            if (_mode == TcpMode.Server)
            {
                if (_server != null)
                {
                    _server.Stop();
                }
                _server = null;
            }
            else if (_mode == TcpMode.Client)
            {
                if (_client != null)
                {
                    _client.Stop();
                }
                _client = null;
            }
        }
Exemple #3
0
        public void Stop()
        {
            if (!_active)
                return;

            if (_mode == TcpMode.Server)
            {
                if(_server != null)
                    _server.Stop();
                _server = null;
            }
            else if (_mode == TcpMode.Client)
            {
                if(_client != null)
                    _client.Stop();
                _client = null;
            }
        }
Exemple #4
0
 public void Start()
 {
     if (_active)
         return;
     _active = true;
     OnActiveUpdate();
     if (_mode == TcpMode.Server) {
         _server = new ACTServer(_plugin);
         _server.Close += OnClose;
         _server.Start();
     }
     else if(_mode == TcpMode.Client) {
         _client = new ACTClient(_plugin);
          _client.Close += OnClose;
        _client.Start();
     }
 }