openvidu-server: KMS disconnection minor refactoring

pull/375/head
pabloFuente 2019-07-29 10:24:13 +02:00
parent 494547e34e
commit 186db129a8
2 changed files with 7 additions and 7 deletions

View File

@ -108,7 +108,7 @@ public class KurentoOptions {
* Defines the maximum number of Kbps that the client owning the token will be * Defines the maximum number of Kbps that the client owning the token will be
* able to receive from Kurento Media Server. 0 means unconstrained. Giving a * able to receive from Kurento Media Server. 0 means unconstrained. Giving a
* value to this property will override the global configuration set in <a href= * value to this property will override the global configuration set in <a href=
* "https://openvidu.io/docs/reference-docs/openvidu-server-params/#list-of-configuration-parameters-when-launching-openvidu-server" * "https://openvidu.io/docs/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server"
* target="_blank">OpenVidu Server configuration</a> (parameter * target="_blank">OpenVidu Server configuration</a> (parameter
* <code>openvidu.streams.video.max-recv-bandwidth</code>) for every incoming * <code>openvidu.streams.video.max-recv-bandwidth</code>) for every incoming
* stream of the user owning the token. <br> * stream of the user owning the token. <br>
@ -125,7 +125,7 @@ public class KurentoOptions {
* Defines the minimum number of Kbps that the client owning the token will try * Defines the minimum number of Kbps that the client owning the token will try
* to receive from Kurento Media Server. 0 means unconstrained. Giving a value * to receive from Kurento Media Server. 0 means unconstrained. Giving a value
* to this property will override the global configuration set in <a href= * to this property will override the global configuration set in <a href=
* "https://openvidu.io/docs/reference-docs/openvidu-server-params/#list-of-configuration-parameters-when-launching-openvidu-server" * "https://openvidu.io/docs/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server"
* target="_blank">OpenVidu Server configuration</a> (parameter * target="_blank">OpenVidu Server configuration</a> (parameter
* <code>openvidu.streams.video.min-recv-bandwidth</code>) for every incoming * <code>openvidu.streams.video.min-recv-bandwidth</code>) for every incoming
* stream of the user owning the token. * stream of the user owning the token.
@ -138,7 +138,7 @@ public class KurentoOptions {
* Defines the maximum number of Kbps that the client owning the token will be * Defines the maximum number of Kbps that the client owning the token will be
* able to send to Kurento Media Server. 0 means unconstrained. Giving a value * able to send to Kurento Media Server. 0 means unconstrained. Giving a value
* to this property will override the global configuration set in <a href= * to this property will override the global configuration set in <a href=
* "https://openvidu.io/docs/reference-docs/openvidu-server-params/#list-of-configuration-parameters-when-launching-openvidu-server" * "https://openvidu.io/docs/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server"
* target="_blank">OpenVidu Server configuration</a> (parameter * target="_blank">OpenVidu Server configuration</a> (parameter
* <code>openvidu.streams.video.max-send-bandwidth</code>) for every outgoing * <code>openvidu.streams.video.max-send-bandwidth</code>) for every outgoing
* stream of the user owning the token. <br> * stream of the user owning the token. <br>
@ -154,7 +154,7 @@ public class KurentoOptions {
* Defines the minimum number of Kbps that the client owning the token will try * Defines the minimum number of Kbps that the client owning the token will try
* to send to Kurento Media Server. 0 means unconstrained. Giving a value to * to send to Kurento Media Server. 0 means unconstrained. Giving a value to
* this property will override the global configuration set in <a href= * this property will override the global configuration set in <a href=
* "https://openvidu.io/docs/reference-docs/openvidu-server-params/#list-of-configuration-parameters-when-launching-openvidu-server" * "https://openvidu.io/docs/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server"
* target="_blank">OpenVidu Server configuration</a> (parameter * target="_blank">OpenVidu Server configuration</a> (parameter
* <code>openvidu.streams.video.min-send-bandwidth</code>) for every outgoing * <code>openvidu.streams.video.min-send-bandwidth</code>) for every outgoing
* stream of the user owning the token. * stream of the user owning the token.

View File

@ -138,11 +138,11 @@ public abstract class KmsManager {
return new KurentoConnectionListener() { return new KurentoConnectionListener() {
@Override @Override
public void reconnected(boolean isReconnected) { public void reconnected(boolean sameServer) {
final Kms kms = kmss.get(kmsId); final Kms kms = kmss.get(kmsId);
kms.setKurentoClientConnected(true); kms.setKurentoClientConnected(true);
kms.setTimeOfKurentoClientConnection(System.currentTimeMillis()); kms.setTimeOfKurentoClientConnection(System.currentTimeMillis());
if (!isReconnected) { if (!sameServer) {
// Different KMS. Reset sessions status (no Publisher or SUbscriber endpoints) // Different KMS. Reset sessions status (no Publisher or SUbscriber endpoints)
log.warn("Kurento Client reconnected to a different KMS instance, with uri {}", kms.getUri()); log.warn("Kurento Client reconnected to a different KMS instance, with uri {}", kms.getUri());
log.warn("Updating all webrtc endpoints for active sessions"); log.warn("Updating all webrtc endpoints for active sessions");
@ -150,12 +150,12 @@ public abstract class KmsManager {
kms.getKurentoSessions().forEach(kSession -> { kms.getKurentoSessions().forEach(kSession -> {
kSession.restartStatusInKurento(timeOfKurentoDisconnection); kSession.restartStatusInKurento(timeOfKurentoDisconnection);
}); });
kms.setTimeOfKurentoClientDisconnection(0);
} else { } else {
// Same KMS. We may infer that openvidu-server/KMS connection has been lost, but // Same KMS. We may infer that openvidu-server/KMS connection has been lost, but
// not the clients/KMS connections // not the clients/KMS connections
log.warn("Kurento Client reconnected to same KMS {} with uri {}", kmsId, kms.getUri()); log.warn("Kurento Client reconnected to same KMS {} with uri {}", kmsId, kms.getUri());
} }
kms.setTimeOfKurentoClientDisconnection(0);
} }
@Override @Override