HTTPConnectionStates.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. namespace BestHTTP.Connections
  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. public 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. /// Wait for the upgraded protocol to shut down.
  19. /// </summary>
  20. WaitForProtocolShutdown,
  21. /// <summary>
  22. /// The Connection is finished processing the request, it's waiting now to deliver it's result.
  23. /// </summary>
  24. Recycle,
  25. /// <summary>
  26. /// The request result's delivered, it's now up to processing again.
  27. /// </summary>
  28. Free,
  29. /// <summary>
  30. /// If it's not a KeepAlive connection, or something happened, then we close this connection and remove from the pool.
  31. /// </summary>
  32. Closed,
  33. /// <summary>
  34. /// Same as the Closed state, but processing this request requires resending the last processed request too.
  35. /// </summary>
  36. ClosedResendRequest
  37. }
  38. }