IProtocol.cs 787 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using BestHTTP.Logger;
  3. namespace BestHTTP.Core
  4. {
  5. public struct HostConnectionKey
  6. {
  7. public readonly string Host;
  8. public readonly string Connection;
  9. public HostConnectionKey(string host, string connection)
  10. {
  11. this.Host = host;
  12. this.Connection = connection;
  13. }
  14. public override string ToString()
  15. {
  16. return string.Format("[HostConnectionKey Host: '{0}', Connection: '{1}']", this.Host, this.Connection);
  17. }
  18. }
  19. public interface IProtocol : IDisposable
  20. {
  21. HostConnectionKey ConnectionKey { get; }
  22. bool IsClosed { get; }
  23. LoggingContext LoggingContext { get; }
  24. void HandleEvents();
  25. void CancellationRequested();
  26. }
  27. }