public HeartbeatExtension(byte mode)
 {
     if (!HeartbeatMode.IsValid(mode))
     {
         throw new ArgumentException("not a valid HeartbeatMode value", "mode");
     }
     this.mMode = mode;
 }
Beispiel #2
0
 public HeartbeatExtension(byte mode)
 {
     //IL_0018: Unknown result type (might be due to invalid IL or missing references)
     if (!HeartbeatMode.IsValid(mode))
     {
         throw new ArgumentException("not a valid HeartbeatMode value", "mode");
     }
     mMode = mode;
 }
Beispiel #3
0
        public static HeartbeatExtension Parse(Stream input)
        {
            byte b = TlsUtilities.ReadUint8(input);

            if (!HeartbeatMode.IsValid(b))
            {
                throw new TlsFatalAlert(47);
            }
            return(new HeartbeatExtension(b));
        }
Beispiel #4
0
        /**
         * Parse a {@link HeartbeatExtension} from a {@link Stream}.
         *
         * @param input
         *            the {@link Stream} to parse from.
         * @return a {@link HeartbeatExtension} object.
         * @throws IOException
         */
        public static HeartbeatExtension Parse(Stream input)
        {
            byte mode = TlsUtilities.ReadUint8(input);

            if (!HeartbeatMode.IsValid(mode))
            {
                throw new TlsFatalAlert(AlertDescription.illegal_parameter);
            }

            return(new HeartbeatExtension(mode));
        }