Merge pull request #2964 from ludovic-henry/sgen-monocontext
[mono.git] / mcs / class / referencesource / System.Web / WebSocketTransitionState.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="WebSocketTransitionState.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //------------------------------------------------------------------------------
6
7 namespace System.Web {
8
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.
12
13     internal enum WebSocketTransitionState : byte {
14
15         // This is not a WebSocket request, or if it is HttpContext.AcceptWebSocketRequest() hasn't yet been called.
16         Inactive = 0,
17
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,
21
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.
26         TransitionStarted,
27
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.
30         TransitionCompleted
31
32     }
33 }