Пример #1
0
 public MqttConnectionContext(
     IMqttPacketSerializer packetSerializer,
     ConnectionContext connection)
 {
     PacketSerializer = packetSerializer;
     Connection       = connection;
 }
Пример #2
0
        public MqttChannelAdapter(IMqttChannel channel, IMqttPacketSerializer serializer, IMqttNetChildLogger logger)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            _channel         = channel ?? throw new ArgumentNullException(nameof(channel));
            PacketSerializer = serializer ?? throw new ArgumentNullException(nameof(serializer));

            _logger = logger.CreateChildLogger(nameof(MqttChannelAdapter));
        }
Пример #3
0
 public MqttChannelAdapter(IMqttChannel channel, IMqttPacketSerializer serializer, IMqttNetLogger logger)
 {
     _logger          = logger ?? throw new ArgumentNullException(nameof(logger));
     _channel         = channel ?? throw new ArgumentNullException(nameof(channel));
     PacketSerializer = serializer ?? throw new ArgumentNullException(nameof(serializer));
 }
        private Task _sendTask = Task.FromResult(0); // this task is used to prevent overlapping write

        public MqttChannelCommunicationAdapter(IMqttCommunicationChannel channel, IMqttPacketSerializer serializer)
        {
            _channel         = channel ?? throw new ArgumentNullException(nameof(channel));
            PacketSerializer = serializer ?? throw new ArgumentNullException(nameof(serializer));
        }
Пример #5
0
 public static bool TryDeserialize(this IMqttPacketSerializer serializer, in ReadOnlySequence <byte> input, out MqttBasePacket packet, out SequencePosition consumed, out SequencePosition observed)