Skip to content
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

disconnect does not appear to send the reason to the server #89

Closed
ericblade opened this issue May 21, 2012 · 9 comments
Closed

disconnect does not appear to send the reason to the server #89

ericblade opened this issue May 21, 2012 · 9 comments
Labels

Comments

@ericblade
Copy link

Calling disconnect("user pressed disconnect button") gives me a quit message of "Client Quit". Either it's not sending the message with the QUIT command, or it's just flat disconnecting before sending..

@villelahdenvuo
Copy link

For me the disconnect doesn't do anything other than call the callback. I tried doing this.send('QUIT', 'message'); manually, but that didn't do anything either.

@ericblade
Copy link
Author

Occasionally, the quit message does come out, so it looks like it's actually disconnecting the connection without actually waiting to make sure that the quit command has happened.

@martynsmith
Copy link
Owner

Hmmm, it seems to be working for me every time.

Perhaps it's over lower latency links or something.

Are you still experiencing this problem?, What IRC server are you seeing the issue on?

@ericblade
Copy link
Author

I've only used it on Freenode, from webOS TouchPads running node 0.4..

@villelahdenvuo
Copy link

I have the following code for quitting. I'm running the bot on IRCNet on a local operator's server.

process.stdin.resume();
process.on('SIGINT', function () {
  console.log('%s received SIGINT', network.name.green);

  network.disconnect('SIGINT', function () {
    console.log('We have now quit from', network.name.green);
    setTimeout(function () { console.log('Still quit.'); }, 1000);
  });
});

What I get:

We have now quit from IRCNet
Still quit.

And on IRC: -!- tuhBot2 [^[email protected]] has quit [EOF From client]

I added the timeout to make sure that Node doesn't exit too soon, but it didn't make any difference. Edit: Using node 0.7.0 currently. Edit2: Tried with 0.7.12, no change.

@villelahdenvuo
Copy link

I have found the root cause. If you use flood protection the send is queued in cmdQueue and the socket is closed before the queue is drained in Client.prototype.activateFloodProtection. If flood protection is off the message is sent correctly.

@valscion
Copy link

👍 please fix this. I've made a dirty hack to overcome this problem but it's just that - a hack.

@wizonesolutions
Copy link

Is disabling flood protection the best workaround for this atm?

@jirwin jirwin added the bug label Jan 29, 2016
@ward
Copy link

ward commented Mar 27, 2016

I believe this was fixed by commit 574f2b0

You can follow the trail via PR #100 which was closed for bug #138 which was closed by said commit.

@jirwin jirwin closed this as completed Mar 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants