From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/5222 Path: main.gmane.org!not-for-mail From: larsi@ifi.uio.no (Lars Magne Ingebrigtsen) Newsgroups: gmane.emacs.gnus.general Subject: Re: Connecting to a newsserver with nntp. Date: 22 Feb 1996 19:03:29 +0100 Organization: Dept. of Informatics, University of Oslo, Norway Sender: larsi@ifi.uio.no Message-ID: References: <9602211956.AA09060@tito.cygnus.com> NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035145859 32189 80.91.224.250 (20 Oct 2002 20:30:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:30:59 +0000 (UTC) Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by deanna.miranova.com (8.7.3/8.6.9) with SMTP id MAA29408 for ; Thu, 22 Feb 1996 12:13:44 -0800 Original-Received: from aegir.ifi.uio.no (4867@aegir.ifi.uio.no [129.240.94.24]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Thu, 22 Feb 1996 19:03:30 +0100 Original-Received: (from larsi@localhost) by aegir.ifi.uio.no ; Thu, 22 Feb 1996 19:03:30 +0100 Original-To: ding@ifi.uio.no In-Reply-To: pp@pfawww.pp.se's message of 22 Feb 1996 08:54:21 +0100 Original-Lines: 37 Xref: main.gmane.org gmane.emacs.gnus.general:5222 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:5222 pp@pfawww.pp.se (Per Persson) writes: > ffap.el which comes with 19.30 does this and has some variables for > it, it's pretty much spread out so I guess you have to poke around in > it a little yuorself. :-) Hmn. Here's the relevant code: (condition-case error (progn (delete-process (open-network-stream "ffap-machine-p" nil host (or service "discard"))) t) (error (let ((mesg (car (cdr error)))) (cond ;; v18: ((string-match "^Unknown host" mesg) nil) ((string-match "not responding$" mesg) mesg) ((equal mesg "connection failed") (if (equal (nth 2 error) "permission denied") nil ; host does not exist ;; Other errors mean host exists: (nth 2 error))) ;; Could be "Unknown service": (t (signal (car error) (cdr error))))))) So it doesn't really ping at all -- it just tries to connect to the "discard" port on the machine. If that fails, then it assumes the machine is down. Anyways, Gnus could do something similar. -- "Yes. The journey through the human heart would have to wait until some other time."