diff --git a/src/node_flv_session.js b/src/node_flv_session.js index e6ccdf1d..5ba8bfe6 100644 --- a/src/node_flv_session.js +++ b/src/node_flv_session.js @@ -91,6 +91,8 @@ class NodeFlvSession { } Logger.log(`[${this.TAG} play] Close stream. id=${this.id} streamPath=${this.playStreamPath}`); Logger.log(`[${this.TAG} disconnect] id=${this.id}`); + this.connectCmdObj.bytesWritten = this.res.socket.bytesWritten; + this.connectCmdObj.bytesRead = this.res.socket.bytesRead; context.nodeEvent.emit('doneConnect', this.id, this.connectCmdObj); this.res.end(); context.idlePlayers.delete(this.id); diff --git a/src/node_rtmp_session.js b/src/node_rtmp_session.js index e0da2d9a..cb0ec882 100644 --- a/src/node_rtmp_session.js +++ b/src/node_rtmp_session.js @@ -217,6 +217,9 @@ class NodeRtmpSession { } Logger.log(`[rtmp disconnect] id=${this.id}`); + + this.connectCmdObj.bytesWritten = this.socket.bytesWritten; + this.connectCmdObj.bytesRead = this.socket.bytesRead; context.nodeEvent.emit('doneConnect', this.id, this.connectCmdObj); context.sessions.delete(this.id);