Exemplo n.º 1
0
        public void Stop()
        {
            if (!IsRunning)
            {
                return;
            }

            _isRunning = false;
            Address    = null;
            Port       = null;
            _serverSocket?.Stop();
            _pubSubRouter.Dispose();
            _thread.Join();
            _thread = null;
            OnStopped?.BeginInvoke(null, null);
        }
Exemplo n.º 2
0
 public override void Stop()
 {
     if (Clients.Count > 0)
     {
         Dictionary <string, object> arguments = new Dictionary <string, object>();
         arguments.Add("Imaging", "Stop");
         foreach (ClientObject client in Clients.Values)
         {
             client.Connections["Main"].Write(Password, new Command(client.Information, Information, CommandType.Custom)
             {
                 Properties = arguments
             });
         }
     }
     try { base.Stop(); }
     catch (Exception error) { throw error; }
     OnStopped?.BeginInvoke(result => { try { OnStopped.EndInvoke(result); } catch { } }, null);
     Port = -1;
 }