Пример #1
0
        public MqttPacketAwaitable(ushort packetIdentifier, MqttPacketDispatcher owningPacketDispatcher)
        {
            Filter = new MqttPacketAwaitableFilter
            {
                Type       = typeof(TPacket),
                Identifier = packetIdentifier
            };

            _owningPacketDispatcher = owningPacketDispatcher ?? throw new ArgumentNullException(nameof(owningPacketDispatcher));
        }
Пример #2
0
        public MqttPacketAwaiter(ushort?packetIdentifier, MqttPacketDispatcher owningPacketDispatcher)
        {
            _packetIdentifier       = packetIdentifier;
            _owningPacketDispatcher = owningPacketDispatcher ?? throw new ArgumentNullException(nameof(owningPacketDispatcher));
#if NET452
            _taskCompletionSource = new TaskCompletionSource <MqttBasePacket>();
#else
            _taskCompletionSource = new TaskCompletionSource <MqttBasePacket>(TaskCreationOptions.RunContinuationsAsynchronously);
#endif
        }
Пример #3
0
 public MqttPacketAwaiter(ushort?packetIdentifier, MqttPacketDispatcher owningPacketDispatcher)
 {
     _packetIdentifier       = packetIdentifier;
     _owningPacketDispatcher = owningPacketDispatcher ?? throw new ArgumentNullException(nameof(owningPacketDispatcher));
 }