Function: nntp-close-server

nntp-close-server is a byte-compiled function defined in nntp.el.gz.

Signature

(nntp-close-server &optional SERVER DEFS)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nntp.el.gz
(deffoo nntp-close-server (&optional server defs)
  (nnoo-change-server 'nntp server defs)
  (nntp-possibly-change-group nil server t)
  (let ((process (nntp-find-connection nntp-server-buffer)))
    (while process
      (when (memq (process-status process) '(open run))
	(ignore-errors
	  (nntp-send-string process "QUIT")
	  (unless (eq nntp-open-connection-function 'nntp-open-network-stream)
	    ;; Ok, this is evil, but when using telnet and stuff
	    ;; as the connection method, it's important that the
	    ;; QUIT command actually is sent out before we kill
	    ;; the process.
	    (sleep-for 1))))
      (nntp-kill-buffer (process-buffer process))
      (setq process (car (pop nntp-connection-alist))))
    (nnoo-close-server 'nntp)))