UNSEEN_TTL = 60 # Time to live, seconds since first request
CHANNEL_MAX = 18 # Max channels open per socket (default)
ANTI_FLOOD_DELAY = 0.125 # Anti-flood delay after transmissions, seconds
-ANTI_BUZZ = 0.09 # Anti-buzz delay after queue-empty check
+ANTI_BUZZ_DELAY = 0.09 # Anti-buzz delay after queue-empty check
# No user-serviceable parts below this line
self.last_xmit = time.time()
except irc.client.ServerConnectionError:
self.status = "disconnected"
+ elif self.status == "handshaking":
+ # Don't buzz on the empty-queue test while we're handshaking
+ time.sleep(ANTI_BUZZ_DELAY)
elif self.queue.empty():
# Queue is empty, at some point we want to time out
# the connection rather than holding a socket open in
# As long as this is less that the duration of a human
# reflex arc it is highly unlikely any human will ever
# notice.
- time.sleep(ANTI_BUZZ)
+ time.sleep(ANTI_BUZZ_DELAY)
elif self.status == "disconnected" \
and time.time() > self.last_xmit + DISCONNECT_TTL:
# Queue is nonempty, but the IRC server might be down. Letting