Enums.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. #if !BESTHTTP_DISABLE_SIGNALR
  2. namespace BestHTTP.SignalR
  3. {
  4. /// <summary>
  5. /// Possible transport types.
  6. /// </summary>
  7. public enum TransportTypes
  8. {
  9. /// <summary>
  10. /// Transport using WebSockets.
  11. /// </summary>
  12. WebSocket,
  13. /// <summary>
  14. /// Transport using ServerSentEvents protocol.
  15. /// </summary>
  16. ServerSentEvents,
  17. /// <summary>
  18. /// Transport using long-polling requests.
  19. /// </summary>
  20. LongPoll
  21. }
  22. /// <summary>
  23. /// Server sent message types
  24. /// </summary>
  25. public enum MessageTypes
  26. {
  27. /// <summary>
  28. /// An empty json object {} sent by the server to check keep alive.
  29. /// </summary>
  30. KeepAlive,
  31. /// <summary>
  32. /// A no-hub message that contains data.
  33. /// </summary>
  34. Data,
  35. /// <summary>
  36. /// A message that can hold multiple data message alongside with other information.
  37. /// </summary>
  38. Multiple,
  39. /// <summary>
  40. /// A method call result.
  41. /// </summary>
  42. Result,
  43. /// <summary>
  44. /// A message about a failed method call.
  45. /// </summary>
  46. Failure,
  47. /// <summary>
  48. /// A message with all information to be able to call a method on the client.
  49. /// </summary>
  50. MethodCall,
  51. /// <summary>
  52. /// A long running server-method's progress.
  53. /// </summary>
  54. Progress
  55. }
  56. /// <summary>
  57. /// Possible SignalR Connection states.
  58. /// </summary>
  59. public enum ConnectionStates
  60. {
  61. /// <summary>
  62. /// The initial state of the connection.
  63. /// </summary>
  64. Initial,
  65. /// <summary>
  66. /// The client authenticates itself with the server. This state is skipped if no AuthenticationProvider is present.
  67. /// </summary>
  68. Authenticating,
  69. /// <summary>
  70. /// The client sent out the negotiation request to the server.
  71. /// </summary>
  72. Negotiating,
  73. /// <summary>
  74. /// The client received the negotiation data, created the transport and wait's for the transport's connection.
  75. /// </summary>
  76. Connecting,
  77. /// <summary>
  78. /// The transport connected and started successfully.
  79. /// </summary>
  80. Connected,
  81. /// <summary>
  82. /// The client started the reconnect process.
  83. /// </summary>
  84. Reconnecting,
  85. /// <summary>
  86. /// The connection is closed.
  87. /// </summary>
  88. Closed
  89. }
  90. /// <summary>
  91. /// Possible types of SignalR requests.
  92. /// </summary>
  93. public enum RequestTypes
  94. {
  95. /// <summary>
  96. /// Request to the /negotiate path to negotiate protocol parameters.
  97. /// </summary>
  98. Negotiate,
  99. /// <summary>
  100. /// Request to the /connect path to connect to the server. With long-polling, it's like a regular poll request.
  101. /// </summary>
  102. Connect,
  103. /// <summary>
  104. /// Request to the /start path to start the protocol.
  105. /// </summary>
  106. Start,
  107. /// <summary>
  108. /// Request to the /poll path to get new messages. Not used with the WebSocketTransport.
  109. /// </summary>
  110. Poll,
  111. /// <summary>
  112. /// Request to the /send path to send a message to the server. Not used with the WebSocketTransport.
  113. /// </summary>
  114. Send,
  115. /// <summary>
  116. /// Request to the /reconnect path to initiate a reconnection. It's used instead of the Connect type.
  117. /// </summary>
  118. Reconnect,
  119. /// <summary>
  120. /// Request to the /abort path to close the connection.
  121. /// </summary>
  122. Abort,
  123. /// <summary>
  124. /// Request to the /ping path to ping the server keeping the asp.net session alive.
  125. /// </summary>
  126. Ping
  127. }
  128. /// <summary>
  129. /// Possible states of a transport.
  130. /// </summary>
  131. public enum TransportStates
  132. {
  133. /// <summary>
  134. /// Initial state
  135. /// </summary>
  136. Initial,
  137. /// <summary>
  138. /// Connecting
  139. /// </summary>
  140. Connecting,
  141. /// <summary>
  142. /// Reconnecting
  143. /// </summary>
  144. Reconnecting,
  145. /// <summary>
  146. /// Sending Start request
  147. /// </summary>
  148. Starting,
  149. /// <summary>
  150. /// Start request finished successfully
  151. /// </summary>
  152. Started,
  153. /// <summary>
  154. /// Sending Abort request
  155. /// </summary>
  156. Closing,
  157. /// <summary>
  158. /// The transport closed after Abort request sent
  159. /// </summary>
  160. Closed
  161. }
  162. }
  163. #endif