comp.lang.ada
 help / color / mirror / Atom feed
From: "REH" <me@you.com>
Subject: Re: Advice on abort
Date: Sat, 05 Nov 2005 21:23:43 GMT
Date: 2005-11-05T21:23:43+00:00	[thread overview]
Message-ID: <zp9bf.104228$K91.53524@twister.nyroc.rr.com> (raw)
In-Reply-To: m2fyqb9c6o.fsf@grendel.local


"Simon Wright" <simon@pushface.org> wrote in message 
news:m2fyqb9c6o.fsf@grendel.local...
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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






  reply	other threads:[~2005-11-05 21:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-04 15:25 Advice on abort REH
2005-11-04 17:15 ` Marc A. Criley
2005-11-04 18:21 ` Dmitry A. Kazakov
2005-11-04 18:35   ` REH
2005-11-05 18:33   ` Simon Wright
2005-11-05 21:23     ` REH [this message]
2005-11-06 11:17       ` Simon Wright
2005-11-06 13:58         ` REH
2005-11-06 20:08           ` Simon Wright
2005-11-06 20:41             ` REH
2005-11-07 14:55 ` Poul-Erik Andreasen
2005-11-07 17:09   ` REH
2005-11-07 18:03     ` Dmitry A. Kazakov
2005-11-08 14:54       ` Poul-Erik Andreasen
2005-11-08 16:14         ` Dmitry A. Kazakov
2005-11-08 16:42           ` Marc A. Criley
2005-11-08 16:59           ` Poul-Erik Andreasen
2005-11-08 20:05             ` Dmitry A. Kazakov
2005-11-09 14:12               ` Poul-Erik Andreasen
2005-11-09 17:14                 ` Dmitry A. Kazakov
2005-11-08 16:32         ` Marc A. Criley
2005-11-08 14:35     ` Poul-Erik Andreasen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox