Exemplo n.º 1
0
        internal async void StopServer()
        {
            Running = false;
            await server.Stop();

            StopSignal.Set();
        }
Exemplo n.º 2
0
    private void Stop()
    {
        if (WorkerSettings.Multithreaded)
        {
            // Signal the thread to stop
            StopSignal.Set();

            // Wait ten seconds for the thread to finish
            ExitedSignal.WaitOne(10 * 1000);

            // Reset the stop and exited flags so that the thread can be restarted
            StopSignal.Reset();
            ExitedSignal.Reset();
        }
        else
        {
            ThreadTeardown();
        }
    }