-
Notifications
You must be signed in to change notification settings - Fork 489
remoteDisconnect feature. #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remoteDisconnect feature. #177
Conversation
index.js
Outdated
| var socket = this.nsp.connected[request.sid]; | ||
| if (!socket) { return; } | ||
|
|
||
| function sendAck(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sendAck function is useless here, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my comment wasn't clear enough! What I thought of was:
case requestTypes.remoteDisconnect:
var socket = this.nsp.connected[request.sid];
if (!socket) { return; }
socket.disconnect(request.close);
// the acknowledgement is still needed
var response = JSON.stringify({
requestid: request.requestid
});
pub.publish(self.responseChannel, response);
break;There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, could you please check it again?
|
Looks good to me! Could you please add a test, and a line in the README? |
|
I'm kinda new to git(hub) but I'll try. |
send acknowledgement in remoteDisconnect call.
|
Thanks for that pull request! I added a test, to prevent future regressions. |
|
You're welcome! |
Please, check carefully before merging, because I'm not sure if I did it right. Thanks!