Ejemplo n.º 1
0
        public MqttPacketAwaitable(ushort packetIdentifier, MqttPacketDispatcher owningPacketDispatcher)
        {
            Filter = new MqttPacketAwaitableFilter
            {
                Type       = typeof(TPacket),
                Identifier = packetIdentifier
            };

            _owningPacketDispatcher = owningPacketDispatcher ?? throw new ArgumentNullException(nameof(owningPacketDispatcher));
        }
Ejemplo n.º 2
0
        public MqttPacketAwaitable(ushort packetIdentifier, MqttPacketDispatcher owningPacketDispatcher)
        {
            Filter = new MqttPacketAwaitableFilter
            {
                Type       = typeof(TPacket),
                Identifier = packetIdentifier
            };

            _owningPacketDispatcher = owningPacketDispatcher ?? throw new ArgumentNullException(nameof(owningPacketDispatcher));
#if NET452
            _taskCompletionSource = new TaskCompletionSource <MqttBasePacket>();
#else
            _taskCompletionSource = new TaskCompletionSource <MqttBasePacket>(TaskCreationOptions.RunContinuationsAsynchronously);
#endif
        }