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; }
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; }
public static string FromStream(Stream data) { var length = data.ReadUint16(); return Encoding.UTF8.GetString(data.ReadBytesOrFailAsync(length).Await().Result); }