Can cancel the sending of the current signal message

This commit is contained in:
Pierre HUBERT 2019-01-19 13:13:21 +01:00
parent 1f0a615e11
commit bc723c5f3c

View File

@ -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();
}
}