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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,be3d89c2ad66a506 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.maxwell.syr.edu!news-rtr.nyroc.rr.com!news-out.nyroc.rr.com!twister.nyroc.rr.com.POSTED!53ab2750!not-for-mail From: "REH" Newsgroups: comp.lang.ada References: <1131117934.372137.244900@g44g2000cwa.googlegroups.com> Subject: Re: Advice on abort X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-RFC2646: Format=Flowed; Original Message-ID: Date: Sat, 05 Nov 2005 21:23:43 GMT NNTP-Posting-Host: 69.205.134.80 X-Complaints-To: abuse@rr.com X-Trace: twister.nyroc.rr.com 1131225823 69.205.134.80 (Sat, 05 Nov 2005 16:23:43 EST) NNTP-Posting-Date: Sat, 05 Nov 2005 16:23:43 EST Organization: Road Runner Xref: g2news1.google.com comp.lang.ada:6248 Date: 2005-11-05T21:23:43+00:00 List-Id: "Simon Wright" wrote in message news:m2fyqb9c6o.fsf@grendel.local... > "Dmitry A. Kazakov" writes: > >> Close that socket from another task. That should end the blocking >> I/O on the socket with some error code. And the task will become >> ready accept a rendezvous. > > We have recently been bitten by OS-dependent behaviour in this area. > > On Windows, the read fails immediately with an > GNAT.Sockets.Socket_Error exception. However, on VxWorks and Linux > (and possibly other OS's), you get a successful read of *zero* bytes > (at any rate, fewer than you requested) and the exception only happens > on the next read. > > Of course, getting a short read may end up with an > Ada.IO_Exceptions.End_Error anyway (we had forgotten to check the > length :-( ). That's fine. We are VxWorks too. Besides, a return of 0 on a read is not considered "successful" with sockets. It means the socket has been closed. You got an exception on the next read, because you were trying to read from a closed socket. REH