From bc723c5f3c29c59cb82577ba26919ec78721952c Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 19 Jan 2019 13:13:21 +0100 Subject: [PATCH] Can cancel the sending of the current signal message --- client/SignalExchangerClient.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/client/SignalExchangerClient.js b/client/SignalExchangerClient.js index dacc182..f27654e 100644 --- a/client/SignalExchangerClient.js +++ b/client/SignalExchangerClient.js @@ -138,6 +138,17 @@ class SignalExchangerClient { this.pending_signal_target = target_id; } + /** + * Stop to try to send the current signal message in queue + * + * This does not cancel the sending of messages already sent through + * socket + */ + cancelCurrentSignal() { + this.pending_signal = undefined; + this.pending_signal_target = undefined; + } + /** * Send data to the server * @@ -169,8 +180,7 @@ class SignalExchangerClient { else { //Else we can remove from this class information about the signal being sent - this.pending_signal = undefined; - this.pending_signal_target = undefined; + this.cancelCurrentSignal(); } }