예제 #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));
 }