Skip to content

Commit

Permalink
Print information about current socket when pending socket is added (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpastro committed Apr 13, 2023
1 parent 0eb1c10 commit c368215
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "msrp-node-lib",
"title": "msrp-node-lib",
"version": "1.0.16-esapp",
"version": "1.0.17-esapp",
"description": "A simple, intuitive MSRP JavaScript library",
"author": {
"email": "cwysong85@gmail.com",
Expand Down
9 changes: 6 additions & 3 deletions src/Session.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,12 @@ module.exports = function (MsrpSdk) {
*/
setSocket(socket, suppressSocketSet = false) {
if (this.socket) {
// This coud be a replacement socket. Add to pending list.
MsrpSdk.Logger.info(`[Session]: Add pending socket for session ${this.sid}. ${socket.socketInfo}`);
this.pendingSockets.push(socket);
MsrpSdk.Logger.info(`[Session]: Current socket for session ${this.sid}. ${this.socket.socketInfo}, Destroyed = ${this.socket.destroyed}`);
if (!this.pendingSockets.includes(socket)) {
// This coud be a replacement socket. Add to pending list.
MsrpSdk.Logger.info(`[Session]: Add pending socket for session ${this.sid}. ${socket.socketInfo}`);
this.pendingSockets.push(socket);
}
if (this.socket.destroyed) {
this.closeSocket(false);
} else if (this.canSend(HEARTBEAT_CONTENT_TYPE, true)) {
Expand Down

0 comments on commit c368215

Please sign in to comment.