comp.lang.ada
 help / color / mirror / Atom feed
From: Jano <nono@celes.unizar.es>
Subject: Re: [OT] Two sockets questions
Date: Thu, 8 May 2003 23:39:09 +0200
Date: 2003-05-08T23:39:09+02:00	[thread overview]
Message-ID: <MPG.1924eceb9f3a7ee89896fd@News.CIS.DFN.DE> (raw)
In-Reply-To: 871xz9hl3n.fsf@inf.enst.fr

Samuel Tardieu dice...
> >>>>> "Jano" == Jano  <nono@celes.unizar.es> 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
-------------------------



  reply	other threads:[~2003-05-08 21:39 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-07 18:03 [OT] Two sockets questions Jano
2003-05-07 18:22 ` Samuel Tardieu
2003-05-07 19:52   ` Stephen Leake
2003-05-07 20:08     ` David C. Hoos
2003-05-07 22:33     ` Jano
2003-05-08  9:10       ` Samuel Tardieu
2003-05-08 21:35         ` Jano
2003-05-09  8:14           ` Samuel Tardieu
2003-05-09 14:32             ` Jano
2003-05-10 14:06         ` Jano
2003-05-10 18:01           ` tmoran
2003-05-10 21:27             ` Samuel Tardieu
2003-05-11 18:01               ` tmoran
2003-05-08 17:48       ` Stephen Leake
2003-05-08 18:42         ` Samuel Tardieu
2003-05-08 21:41           ` Jano
2003-05-08 21:48           ` Jano
2003-05-08 22:35             ` tmoran
2003-05-09 14:42               ` Jano
2003-05-10  8:57                 ` Tarjei T. Jensen
2003-05-10 16:55                   ` Simon Wright
2003-05-11 18:23                   ` Tarjei T. Jensen
2003-05-11  2:05                 ` tmoran
2003-05-08 21:40         ` Jano
2003-05-07 20:02   ` Jano
2003-05-08  8:57     ` Samuel Tardieu
2003-05-08 21:39       ` Jano [this message]
2003-05-08 10:14   ` Preben Randhol
2003-05-08 11:09     ` Samuel Tardieu
2003-05-08 21:40       ` Jano
2003-05-09  8:19         ` Samuel Tardieu
2003-05-08 18:06     ` tmoran
2003-05-07 20:09 ` tmoran
replies disabled

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