예제 #1
0
        public void Abort()
        {
            Log.Debug("Server abort started...");

            Queue.Abort();
            Sessions.Abort();
            Http.Stop();
        }
예제 #2
0
        public void Abort()
        {
            Queue.Abort();
            Sessions.Abort();

            try {
                receiver?.Dispose();
                receiver = null;
            }
            catch (Exception error) {
                Log.Error("Failed to stop HTTP Receiver!", error);
            }
        }
예제 #3
0
        public void Abort()
        {
            Log.Debug("Server abort started...");

            Queue.Abort();
            Sessions.Abort();

            try {
                receiver?.Dispose();
                receiver = null;
            }
            catch (Exception error) {
                Log.Error("Failed to stop HTTP Receiver!", error);
            }
        }
예제 #4
0
        public async Task Shutdown(TimeSpan timeout)
        {
            using (var tokenSource = new CancellationTokenSource(timeout)) {
                var token = tokenSource.Token;

                token.Register(() => {
                    Queue.Abort();
                    Sessions.Abort();
                });

                await Task.Run(() => {
                    Queue.Stop();
                    Sessions.Stop();
                }, token);
            }
        }
예제 #5
0
        public async Task Shutdown(TimeSpan timeout)
        {
            Log.Debug("Shutdown started...");

            using (var tokenSource = new CancellationTokenSource(timeout)) {
                var token = tokenSource.Token;

                using (token.Register(() => {
                    Queue.Abort();
                    Sessions.Abort();
                })) {
                    await Task.Run(() => {
                        Queue.Stop();
                        Sessions.Stop();
                    }, token);
                }
            }
        }