Exemplo n.º 1
0
        internal static V3ConnectVariableHeader FromStream(Stream stream)
        {
            var header = new V3ConnectVariableHeader
                {
                    ProtocolName = MQString.FromStream(stream),
                    Protocolversion = stream.ReadByteOrFail(),
                    ConnectFlags = ConnectFlags.FromStream(stream),
                    KeepAliveTimer = stream.ReadUint16()
                };

            return header;
        }
Exemplo n.º 2
0
        internal static V3ConnectVariableHeader FromStream(Stream stream)
        {
            var header = new V3ConnectVariableHeader
                {
                    ProtocolName = MqString.FromStream(stream),
                    Protocolversion = stream.ReadBytesOrFailAsync(1).Await().Result[0],
                    ConnectFlags = ConnectFlags.FromStream(stream),
                    KeepAliveTimer = stream.ReadUint16()
                };

            return header;
        }
Exemplo n.º 3
0
 public static string FromStream(Stream data)
 {
     var length = data.ReadUint16();
     return Encoding.UTF8.GetString(data.ReadBytesOrFailAsync(length).Await().Result);
 }