.connect() takes a long time to join channels #8

Closed
walkah opened this Issue Apr 21, 2011 · 3 comments

Projects

None yet

2 participants

@walkah
walkah commented Apr 21, 2011

hacking together a bot for some internal use and jerk(function() {}).connect(options) connects (to freenode) quickly, but takes a very long time to join the channels listed in options['channels'] - making it not that fun to hack on.

I'm not sure if this is an issue in jerk or irc-js...

@gf3
Owner
gf3 commented Apr 21, 2011

In order to function correctly on a wide variety of networks, Jerk, by default is set to join channels 15 seconds after it receives a PING from the server. This prevents the bot from trying to join channels too soon, then failing to join them at all. To cut down this time, you can change the timeout in the options to something shorter like so options.delayAfterConnect = 1.

Relevant Jerk code: https://github.com/gf3/Jerk/blob/master/lib/jerk.js#L32-42

@gf3
Owner
gf3 commented Apr 21, 2011

I should probably make this shorter by default though.

@gf3 gf3 added a commit that closed this issue Apr 21, 2011
@gf3 updated: Lowered channel joining time. Fixes #8.
* Reduced default value for `delayAfterConnect` to 1s.
* Added a new option `waitForPing` which is false by default.
a56f080
@gf3 gf3 closed this in a56f080 Apr 21, 2011
@walkah
walkah commented Apr 21, 2011

that's much better! thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment