// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; namespace Microsoft.AspNetCore.Razor.Tools { internal struct ConnectionResult { public readonly Reason CloseReason; public readonly TimeSpan? KeepAlive; public ConnectionResult(Reason closeReason, TimeSpan? keepAlive = null) { CloseReason = closeReason; KeepAlive = keepAlive; } public enum Reason { /// /// There was an error creating the request object and a compilation was never created. /// CompilationNotStarted, /// /// The compilation completed and results were provided to the client. /// CompilationCompleted, /// /// The compilation process was initiated and the client disconnected before the results could be provided to them. /// ClientDisconnect, /// /// There was an unhandled exception processing the result. /// ClientException, /// /// There was a request from the client to shutdown the server. /// ClientShutdownRequest, } } }