CloseStatusCodeRfc6455.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace SuperWebSocket.Protocol
  6. {
  7. /// <summary>
  8. /// Close status code for rfc6455
  9. /// </summary>
  10. public class CloseStatusCodeRfc6455 : ICloseStatusCode
  11. {
  12. /// <summary>
  13. /// Initializes a new instance of the <see cref="CloseStatusCodeRfc6455"/> class.
  14. /// </summary>
  15. public CloseStatusCodeRfc6455()
  16. {
  17. NormalClosure = 1000;
  18. GoingAway = 1001;
  19. ProtocolError = 1002;
  20. NotAcceptableData = 1003;
  21. TooLargeFrame = 1009;
  22. InvalidUTF8 = 1007;
  23. ViolatePolicy = 1008;
  24. ExtensionNotMatch = 1010;
  25. UnexpectedCondition = 1011;
  26. NoStatusCode = 1005;
  27. }
  28. /// <summary>
  29. /// Gets the code for normal closure.
  30. /// </summary>
  31. public int NormalClosure { get; private set; }
  32. /// <summary>
  33. /// Gets the code for going away.
  34. /// </summary>
  35. public int GoingAway { get; private set; }
  36. /// <summary>
  37. /// Gets the code for protocol error.
  38. /// </summary>
  39. public int ProtocolError { get; private set; }
  40. /// <summary>
  41. /// Gets the code for not acceptable data.
  42. /// </summary>
  43. public int NotAcceptableData { get; private set; }
  44. /// <summary>
  45. /// Gets the code for too large frame.
  46. /// </summary>
  47. public int TooLargeFrame { get; private set; }
  48. /// <summary>
  49. /// Gets the code for invalid UT f8.
  50. /// </summary>
  51. public int InvalidUTF8 { get; private set; }
  52. /// <summary>
  53. /// Gets the code for violate policy.
  54. /// </summary>
  55. public int ViolatePolicy { get; private set; }
  56. /// <summary>
  57. /// Gets the code for extension not match.
  58. /// </summary>
  59. public int ExtensionNotMatch { get; private set; }
  60. /// <summary>
  61. /// Gets the code for unexpected condition.
  62. /// </summary>
  63. public int UnexpectedCondition { get; private set; }
  64. /// <summary>
  65. /// Gets the code for TLS handshake failure.
  66. /// </summary>
  67. public int TLSHandshakeFailure { get; private set; }
  68. /// <summary>
  69. /// Gets the code for no status code.
  70. /// </summary>
  71. public int NoStatusCode { get; private set; }
  72. }
  73. }