+ private hasClientSocketsInBadHealth (sessionId: string) {
+ const rtmpSession = this.getContext().sessions.get(sessionId)
+
+ if (!rtmpSession) {
+ logger.warn('Cannot get session %s to check players socket health.', sessionId)
+ return
+ }
+
+ for (const playerSessionId of rtmpSession.players) {
+ const playerSession = this.getContext().sessions.get(playerSessionId)
+
+ if (!playerSession) {
+ logger.error('Cannot get player session %s to check socket health.', playerSession)
+ continue
+ }
+
+ if (playerSession.socket.writableLength > VIDEO_LIVE.MAX_SOCKET_WAITING_DATA) {
+ return true
+ }
+ }
+
+ return false
+ }
+