Subject: Select bug in beta 16?
From: [email-masked] (Bala Parthasarathy)

15 Nov 1996 01:24:35 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: [email-masked]
Original-Sender: [email-masked]

I'm using b16 of the gnu-win32 environment to port my Unix
app to NT 3.51. One of my applications is a server, which
uses UDP sockets for communications. I'm seeing the following
problem with select in the server and it'll be great if anyone can shed some
light on it. 
Thanks to the folks at Cygnus in doing a terrific job
in making Unix->NT port smooth for the most part.

The problem:
  Messages from clients to the server time out almost always.
The cause:
  select() seems to be buggy: in particular, there seems to be some 
  problem in the timeout. Consider the foll. code fragment:
      struct timeval time_out;
      time_out.tv_sec  = 60;
      time_out.tv.usec = 0;
      retval = select(max_fd + 1, &read_mask, NULL, NULL, &time_out);
  This should return after 60 seconds or when a message arrives, 
  whichever happens sooner, right?
  What actually happens is that the first time around, it only returns 
  after 60 seconds. Even then it only tells you that it timed 
  out even when there is a message.  So our server breaks from 
  a select after about 60 secs and thinks there are no messages 
  even when there are. It then re-selects() and breaks almost 
  immediately with the news that there is a message.

Workaround:
  If I use very short timeout values (I tried 1 sec) and everything 
  seems to be fine.  The shorter the interval the more it 
  approximates constantly polling all fd's.  Presumably this 
  could bring the system to its knees?

Does anyone have any experience with using select and an earlier
beta, like beta14 maybe?

Bala 
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".