1 //------------------------------------------------------------------------------
2 // <copyright file="WebSocketTransitionState.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //------------------------------------------------------------------------------
9 // Represents the transition state of a WebSocket request.
10 // Any state can be a terminal state, but if a state transition does take place it will go in the
11 // order Inactive -> AcceptWebSocketRequestCalled -> TransitionStarted -> TransitionCompleted.
13 internal enum WebSocketTransitionState : byte {
15 // This is not a WebSocket request, or if it is HttpContext.AcceptWebSocketRequest() hasn't yet been called.
18 // HttpContext.AcceptWebSocketRequest() has been called, but we haven't yet started the transition.
19 // This means that the request handler or ASP.NET modules may still be running.
20 AcceptWebSocketRequestCalled,
22 // We have started the transition, e.g. we're in the process of tearing down request state and releasing
23 // objects (like HttpApplication instances) back into their respective pools. The handshake with the client
24 // will also be performed during this time. Asynchronous module-level events (like SendResponse) should
25 // not be fired after this point.
28 // We have completed the transition, e.g. the handshake is completed and we have an active connection
29 // with the client. The callback the developer passed to HttpContext.AcceptWebSocketRequest() is executing.