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,8ee4430d1820a774 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!w56g2000hsf.googlegroups.com!not-for-mail From: gpriv@axonx.com Newsgroups: comp.lang.ada Subject: Re: GNAT.Sockets: Timeval_Duration is in milliseconds? Date: Sun, 9 Dec 2007 15:27:32 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <9d687056-c98b-405a-b166-afddac34f109@e67g2000hsc.googlegroups.com> <99906a58-2645-4880-bd13-9b63a30ffb59@e4g2000hsg.googlegroups.com> <8808f9fb-64a5-4a44-9684-dc0446a26bbc@b1g2000pra.googlegroups.com> NNTP-Posting-Host: 151.196.71.114 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1197242853 3057 127.0.0.1 (9 Dec 2007 23:27:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 9 Dec 2007 23:27:33 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w56g2000hsf.googlegroups.com; posting-host=151.196.71.114; posting-account=YaY8rAoAAAAAnFXOECY3BGVJsrvFJCgy User-Agent: G2/1.0 X-HTTP-Via: 1.1 SPARKS X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:18840 Date: 2007-12-09T15:27:32-08:00 List-Id: On Dec 9, 5:51 pm, Simon Wright wrote: > gp...@axonx.com writes: > >http://msdn2.microsoft.com/en-us/library/ms740532.aspx > > > "Sets a timeout, in milliseconds, for blocking receive calls. The > > default for this option is zero, which indicates that a receive > > operation will not time out. If a blocking receive call times out, > > the connection is in an indeterminate state and should be closed." > > So if you are using Windows, Microsoft's decision to screw things up > by using a different socket argument structure from the pre-existing > BSD argument structure means that the current GNAT code indeed works in > milliseconds instead of the seconds it is trying to. > > I suppose we have to report this as a bug in GNAT though it would be > much more satisfactory to have Microsoft fix it where it should be > fixed. It could never have been the intention to have the effect you > observe! > > Which version of GNAT are you using? > > Personally I've never used timeouts -- I've used select() and waited > 'forever'. Isn't MS always making things "Better" without us even knowing it :-) I use GPS 4.1.3 (20070913), GNAT GPL 2007 (20070405-41) I prefer sockets with timeouts since the application is monitoring many (1..100) "field" devices and it is written around abstract device interfaces. Sets with only one socket seems to be overcomplication, besides I am not sure that timeouts there are not screwed-up on windows either. Those devices send data at least every second, but may "die" quietly and unexpectedly and that should be detected in short order. Timeout works fine when numbers are right. It may be good idea to fix windows version of GNAT though. Regards, George