Function: erc-server-PING

erc-server-PING is a byte-compiled function defined in erc-backend.el.gz.

Signature

(erc-server-PING PROC PARSED)

Documentation

Handle ping messages.

Handler for a PING server response. PROC is the server process which returned the response. PARSED is the actual response as an ‘erc-response’ struct. If you want to add responses don’t modify this function, but rather add things to ‘erc-server-PING-functions’ instead.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-backend.el.gz
(define-erc-response-handler (PING)
  "Handle ping messages." nil
  (let ((pinger (car (erc-response.command-args parsed))))
    (erc-log (format "PING: %s" pinger))
    ;; ping response to the server MUST be forced, or you can lose big
    (erc-server-send (format "PONG :%s" pinger) t)
    (when erc-verbose-server-ping
      (erc-display-message
       parsed 'error proc
       'PING ?s (erc-time-diff erc-server-last-ping-time (erc-current-time))))
    (setq erc-server-last-ping-time (erc-current-time))))