HeartbeatMode.cs 576 B

12345678910111213141516171819202122
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
  5. {
  6. /*
  7. * RFC 6520
  8. */
  9. public abstract class HeartbeatMode
  10. {
  11. public const byte peer_allowed_to_send = 1;
  12. public const byte peer_not_allowed_to_send = 2;
  13. public static bool IsValid(byte heartbeatMode)
  14. {
  15. return heartbeatMode >= peer_allowed_to_send && heartbeatMode <= peer_not_allowed_to_send;
  16. }
  17. }
  18. }
  19. #pragma warning restore
  20. #endif