Function: erc--recon-probe-check

erc--recon-probe-check is a byte-compiled function defined in erc-backend.el.gz.

Signature

(erc--recon-probe-check PROC EXPIRE)

Documentation

Restart reconnect probe if PROC has failed or EXPIRE time has passed.

Otherwise, if PROC's buffer is live and its status is connect, arrange for running again in 1 second.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-backend.el.gz
(defun erc--recon-probe-check (proc expire)
  "Restart reconnect probe if PROC has failed or EXPIRE time has passed.
Otherwise, if PROC's buffer is live and its status is `connect', arrange
for running again in 1 second."
  (let* ((buffer (process-buffer proc))
         ;;
         status)
    (cond ((not (buffer-live-p buffer)))
          ((time-less-p expire (current-time))
           ;; TODO convert into proper catalog message for i18n.
           (erc-display-message nil 'error buffer "Timed out while dialing...")
           (erc--recon-probe-reschedule proc))
          ((eq (setq status (process-status proc)) 'failed)
           (erc--recon-probe-reschedule proc))
          ((eq status 'connect)
           (run-at-time 1 nil #'erc--recon-probe-check proc expire)))))