From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,URI_HEX autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c22949b5ebf3505f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-08 14:39:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!skynet.be!skynet.be!fu-berlin.de!uni-berlin.de!212.97.175.23!not-for-mail From: Jano Newsgroups: comp.lang.ada Subject: Re: [OT] Two sockets questions Date: Thu, 8 May 2003 23:39:09 +0200 Message-ID: References: <8765omaa6b.fsf@inf.enst.fr> <871xz9hl3n.fsf@inf.enst.fr> NNTP-Posting-Host: 212.97.175.23 X-Trace: fu-berlin.de 1052429949 19705731 212.97.175.23 (16 [49872]) X-Newsreader: MicroPlanet Gravity v2.50 Xref: archiver1.google.com comp.lang.ada:37080 Date: 2003-05-08T23:39:09+02:00 List-Id: Samuel Tardieu dice... > >>>>> "Jano" == Jano writes: > > Jano> A idea that comes to me: If I do a read for 0 bytes, will occur > Jano> the same? I mean, if connection is alive, nothing happens, and > Jano> if it's dead, error... > > I do not understand your question. I mean: I try to read a 0 length vector. If the connection is okay, nothing happens. If the other end has shutdown and there is no remaining data to be read, some error is returned (even trying to read 0 bytes). I see in the Gnat.Sockets comments that a read in a closed socket sets Last to -1. However, that option is not valid: If you try to read a 0- length array from an alive connection, "Operation would block" is raised anyway. (Now I wonder if doing so in a non-blocking socket would have some effect. I suppose no, and without blocking or exceptions. Kinda amusing). -- ------------------------- Jano 402450.at.cepsz.unizar.es -------------------------