Enums.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #if !BESTHTTP_DISABLE_SOCKETIO
  2. namespace BestHTTP.SocketIO
  3. {
  4. /// <summary>
  5. /// Possible event types on the transport level.
  6. /// </summary>
  7. public enum TransportEventTypes : int
  8. {
  9. Unknown = -1,
  10. Open = 0,
  11. Close = 1,
  12. Ping = 2,
  13. Pong = 3,
  14. Message = 4,
  15. Upgrade = 5,
  16. Noop = 6
  17. }
  18. /// <summary>
  19. /// Event types of the SocketIO protocol.
  20. /// </summary>
  21. public enum SocketIOEventTypes : int
  22. {
  23. Unknown = -1,
  24. /// <summary>
  25. /// Connect to a namespace, or we connected to a namespace
  26. /// </summary>
  27. Connect = 0,
  28. /// <summary>
  29. /// Disconnect a namespace, or we disconnected from a namespace.
  30. /// </summary>
  31. Disconnect = 1,
  32. /// <summary>
  33. /// A general event. The event's name is in the payload.
  34. /// </summary>
  35. Event = 2,
  36. /// <summary>
  37. /// Acknowledgment of an event.
  38. /// </summary>
  39. Ack = 3,
  40. /// <summary>
  41. /// Error sent by the server, or by the plugin
  42. /// </summary>
  43. Error = 4,
  44. /// <summary>
  45. /// A general event with binary attached to the packet. The event's name is in the payload.
  46. /// </summary>
  47. BinaryEvent = 5,
  48. /// <summary>
  49. /// Acknowledgment of a binary event.
  50. /// </summary>
  51. BinaryAck = 6
  52. }
  53. /// <summary>
  54. /// Possible error codes that the SocketIO server can send.
  55. /// </summary>
  56. public enum SocketIOErrors
  57. {
  58. /// <summary>
  59. /// Transport unknown
  60. /// </summary>
  61. UnknownTransport = 0,
  62. /// <summary>
  63. /// Session ID unknown
  64. /// </summary>
  65. UnknownSid = 1,
  66. /// <summary>
  67. /// Bad handshake method
  68. /// </summary>
  69. BadHandshakeMethod = 2,
  70. /// <summary>
  71. /// Bad request
  72. /// </summary>
  73. BadRequest = 3,
  74. /// <summary>
  75. /// Plugin internal error!
  76. /// </summary>
  77. Internal,
  78. /// <summary>
  79. /// Exceptions that caught by the plugin but raised in a user code.
  80. /// </summary>
  81. User,
  82. /// <summary>
  83. /// A custom, server sent error, most probably from a Socket.IO middleware.
  84. /// </summary>
  85. Custom,
  86. }
  87. }
  88. #endif