WebSocketState.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. namespace SocketHttpListener
  2. {
  3. /// <summary>
  4. /// Contains the values of the state of the WebSocket connection.
  5. /// </summary>
  6. /// <remarks>
  7. /// The values of the state are defined in
  8. /// <see href="http://www.w3.org/TR/websockets/#dom-websocket-readystate">The WebSocket
  9. /// API</see>.
  10. /// </remarks>
  11. public enum WebSocketState : ushort
  12. {
  13. /// <summary>
  14. /// Equivalent to numeric value 0.
  15. /// Indicates that the connection has not yet been established.
  16. /// </summary>
  17. Connecting = 0,
  18. /// <summary>
  19. /// Equivalent to numeric value 1.
  20. /// Indicates that the connection is established and the communication is possible.
  21. /// </summary>
  22. Open = 1,
  23. /// <summary>
  24. /// Equivalent to numeric value 2.
  25. /// Indicates that the connection is going through the closing handshake or
  26. /// the <c>WebSocket.Close</c> method has been invoked.
  27. /// </summary>
  28. Closing = 2,
  29. /// <summary>
  30. /// Equivalent to numeric value 3.
  31. /// Indicates that the connection has been closed or couldn't be opened.
  32. /// </summary>
  33. Closed = 3
  34. }
  35. }