Function: rcirc-keepalive

rcirc-keepalive is a byte-compiled function defined in rcirc.el.gz.

Signature

(rcirc-keepalive)

Documentation

Send keep alive pings to active rcirc processes.

Kill processes that have not received a server message since the last ping.

Source Code

;; Defined in /usr/src/emacs/lisp/net/rcirc.el.gz
(defun rcirc-keepalive ()
  "Send keep alive pings to active rcirc processes.
Kill processes that have not received a server message since the
last ping."
  (if (rcirc-process-list)
      (mapc (lambda (process)
              (with-rcirc-process-buffer process
                (when (not rcirc-connecting)
                  (condition-case nil
                      (rcirc-send-ctcp process
                                       rcirc-nick
                                       (format "KEEPALIVE %f"
                                               (float-time)))
                    (rcirc-closed-connection
                     (if (zerop rcirc-reconnect-delay)
                         (message "rcirc: Connection to %s closed"
                                  (process-name process))
                       (rcirc-reconnect process))
                     (message ""))))))
            (rcirc-process-list))
    ;; no processes, clean up timer
    (when (timerp rcirc-keepalive-timer)
      (cancel-timer rcirc-keepalive-timer))
    (setq rcirc-keepalive-timer nil)))