HTTPConnectionStates.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. namespace BestHTTP
  2. {
  3. /// <summary>
  4. /// Possible states of a Http Connection.
  5. /// The ideal lifecycle of a connection that has KeepAlive is the following: Initial => [Processing => WaitForRecycle => Free] => Closed.
  6. /// </summary>
  7. internal enum HTTPConnectionStates
  8. {
  9. /// <summary>
  10. /// This Connection instance is just created.
  11. /// </summary>
  12. Initial,
  13. /// <summary>
  14. /// This Connection is processing a request
  15. /// </summary>
  16. Processing,
  17. /// <summary>
  18. /// The request redirected.
  19. /// </summary>
  20. Redirected,
  21. /// <summary>
  22. /// The connection is upgraded from http.
  23. /// </summary>
  24. Upgraded,
  25. /// <summary>
  26. /// Wait for the upgraded protocol to shut down.
  27. /// </summary>
  28. WaitForProtocolShutdown,
  29. /// <summary>
  30. /// The Connection is finished processing the request, it's waiting now to deliver it's result.
  31. /// </summary>
  32. WaitForRecycle,
  33. /// <summary>
  34. /// The request result's delivered, it's now up to processing again.
  35. /// </summary>
  36. Free,
  37. /// <summary>
  38. /// A request from outside of the plugin to abort the connection.
  39. /// </summary>
  40. AbortRequested,
  41. /// <summary>
  42. /// The request is not finished in the given time.
  43. /// </summary>
  44. TimedOut,
  45. /// <summary>
  46. /// If it's not a KeepAlive connection, or something happend, then we close this connection and remove from the pool.
  47. /// </summary>
  48. Closed
  49. }
  50. }