コード例 #1
0
ファイル: MqttClientImpl.cs プロジェクト: jangocheng/mqtt-2
        void Close(DisconnectedReason reason, string message = null)
        {
            tracer.Info(Properties.Resources.Client_Closing, Id, reason);

            CloseClientSession();
            packetsSubscription?.Dispose();
            packetListener?.Dispose();
            Channel?.Dispose();
            IsConnected = false;
            Id          = null;

            Disconnected(this, new MqttEndpointDisconnected(reason, message));
        }
コード例 #2
0
        void Close(DisconnectedReason reason, string message = null)
        {
            tracer.Info(Properties.Resources.Client_Disposing, Id, reason);

            receiver?.OnCompleted();
            packetsSubscription?.Dispose();
            packetListener?.Dispose();
            packetChannel?.Dispose();
            (clientSender as IDisposable)?.Dispose();
            IsConnected = false;
            Id          = null;

            Disconnected(this, new MqttEndpointDisconnected(reason, message));
        }