Re: GNAT.Sockets: Timeval_Duration is in milliseconds?



On Dec 9, 5:51 pm, Simon Wright <simon.j.wri...@xxxxxxx> wrote:
gp...@xxxxxxxxx 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


.



Relevant Pages

  • Re: GNAT GPL 2005: Too clever by half?
    ... GNAT GPL 2005 Edition is just fine. ... They don't want to spend time trying to figure out how to get a compiler environment built for windows - they want to install it and get on with developing. ... Most of the people I've got using Ada are using Gnat 3.15p and they may not feel a need to switch. ...
    (comp.lang.ada)
  • Re: Hey Frozenator
    ... bottom of the hill, soooo...it's Gnat Central here. ... until I put my glasses on that is. ... and do a "bug check" before I use the bathroom. ... The windows have these heavy plastic, almost mylar coverings, like ...
    (alt.2600)
  • New Ada ANSI console/X terminal game
    ... Windows, even assuming that there is a suitable ANSI terminal ... Ada.Command_Line.Environment (I didn't use it myself because GNAT ... To compile under Linux/Unix, assuming you have GNAT and libadasockets ... (from The Mainspring of Human Progress) ...
    (comp.lang.ada)
  • Re: Should COBOL be lockedUP for good?...
    ... Windows had demonstrated that if a client ... I don't think that 'Timeouts' are sensible. ... why I would want to lock a record for some hours, ...
    (comp.lang.cobol)
  • Re: Welche Socket Komponente/ Klasse eignet sich gut für Timeouts?
    ... je nach windows interna. ... HANDLE xEvent; ... WSAWaitForMultipleEvents ... Welche Socket Komponente eignet sich gut für Timeouts? ...
    (microsoft.public.de.vc)