From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Chris Vine Newsgroups: gmane.lisp.guile.user Subject: Re: How to notice abrupt tcp connection losses in server/client? Date: Sat, 23 Jun 2018 12:42:52 +0100 Message-ID: <20180623124252.c9e82c3f64985a7ae440c8c7@gmail.com> References: <965d5042-8d91-6729-e357-92cab60ca52b@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1529754075 25706 195.159.176.226 (23 Jun 2018 11:41:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 23 Jun 2018 11:41:15 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jun 23 13:41:11 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fWguk-0006Yh-SG for guile-user@m.gmane.org; Sat, 23 Jun 2018 13:41:10 +0200 Original-Received: from localhost ([::1]:38081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWgwq-0003bi-En for guile-user@m.gmane.org; Sat, 23 Jun 2018 07:43:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWgwT-0003bR-1J for guile-user@gnu.org; Sat, 23 Jun 2018 07:42:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWgwS-0001vU-9h for guile-user@gnu.org; Sat, 23 Jun 2018 07:42:57 -0400 Original-Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:38670) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fWgwS-0001tl-2Z for guile-user@gnu.org; Sat, 23 Jun 2018 07:42:56 -0400 Original-Received: by mail-wm0-x233.google.com with SMTP id 69-v6so5240332wmf.3 for ; Sat, 23 Jun 2018 04:42:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=9gxpDuZkIflkyxoe/bgCOtVDZXcGIn21m0Owj0joxpQ=; b=A3jZfN+PotS3S8xf0ppzuNOJcwIeNpVdMP56Ky8ATZfp0TeLavzuI5HSHZ4DOg7gc9 Wti+5Sx/11wor42swUjmS0iakO2bH/40ugpn9teySnstvpnTr58LHePVqkSQtlPeR4e7 4cgrLS9Cc4cgw+lD0gEekQh8pFQ/+TmBdRYOu8N/zBWHYcCMi6Orja/XYTsEzkOcVjoO LtIqGrjSSh6b57jZDgL/ZdjrF0aQqJ8znd2mkLhFUO0VZahyFaqR592xgGAAMjOhPWxm PjpjhfzuuIprGTb+FigPJAPjfy4wvZZLAD3zOj9YBV8EzioX++Bs8NTq3QTKK+JMZMUZ hfjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9gxpDuZkIflkyxoe/bgCOtVDZXcGIn21m0Owj0joxpQ=; b=O6v230/rgu5wQymdx3EVzlw1cnpQw0QRG9PioZl4hYOhlYjOnrjHwPeG3OmjIEeUIC 5c5ZCdTmbwbV0yoo3kolSeoj3wimDnoCkGxiG5l8ln7YiWJYIk2lHSvFDDkG6wb9c5/y qese6A7ebV2n/c7MLE1xaTgGFntY5p29iRSzIHYHHyY6l1IIaUACLkOIiwhtBUDthRI+ lMacUQKnxubyxPGpWlkT/aJfYe8hpAuDNGLC9Pu+jdnAkesXVLRczeXF7XkG7SU3OFya 48iiSBVDIo7gqZv06frwxGra5P2CR8NUBtUCOcxsBz9j+pxcj4fcAyNx2khBSAl5bydb 0UNQ== X-Gm-Message-State: APt69E3vymmD+X5TlO233IxSmX0x2xdIrmYfxFXxyHG9H26m13NrSAc0 hieDu+r72oVpbkpLWNb86i+PTA== X-Google-Smtp-Source: ADUXVKLcU88XDNW8pvJRO//MbSEB5O3EWRgz3ddG1Y2H0A1Ndebdui11N+x/egj7GJXvtg7ntWTMpQ== X-Received: by 2002:a1c:8cc8:: with SMTP id o191-v6mr4372237wmd.75.1529754174298; Sat, 23 Jun 2018 04:42:54 -0700 (PDT) Original-Received: from bother.homenet ([2002:5f92:705d:10:5117:1381:88c9:f9ff]) by smtp.gmail.com with ESMTPSA id t9-v6sm2787614wmh.41.2018.06.23.04.42.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jun 2018 04:42:53 -0700 (PDT) Original-Received: from bother.homenet (localhost [127.0.0.1]) by bother.homenet (Postfix) with SMTP id 1FBE9261E8C for ; Sat, 23 Jun 2018 12:42:52 +0100 (BST) In-Reply-To: <965d5042-8d91-6729-e357-92cab60ca52b@gmail.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::233 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14652 Archived-At: On Fri, 22 Jun 2018 22:17:51 +0200 Zelphir Kaltstahl wrote: [snip] > ... it returns 0 for end of file (what is the difference between this > and end of file object? R6RS states that "The end-of-file object is returned by various I/O procedures when they reach end of file". It can be obtained by invoking the R6RS eof-object procedure and can be queried with the eof-object? predicate, so '(eof-object? (eof-object))' will evaluate to true. R6RS also says "The end-of-file object is not a datum value, and thus has no external representation". 0 is an integer. POSIX read() and recv() indicate end-of-file by unblocking and returning 0. Subsequent calls to read() or recv() might return -1 indicating an error, in which case recv! would throw an exception.