This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: 1.3.2: Cygwin && UDP && O_NONBLOCK


On Tue, 14 Aug 2001, Troy Noble wrote:

> Unless I misunderstood entirely, I think you've found a bug.

Ok, I see what has happened. The real assertion is that NONBLOCKING i/o on
udp doesn't work, not that blocking i/o doesn't work. This confused me
because the original poster wrote:

   [snip]
   flags = fcntl(sock, F_GETFL, 0);
   ret = fcntl(sock, F_SETFL, flags & ~O_NONBLOCK);
   [snip]

This certainly forces the socket to blocking mode.

   Under Linux:
   ~
   [root@xml /tmp]# gcc -Wall -o server server.c
   [root@xml /tmp]# ./server
   (ctrl + c)
   [root@xml /tmp]#
   ~
   (Nice blocking..)

   Under Cygwin:
   ~
   Administrator@PIGGY ~/cvsroot/blocktest
   $ gcc -Wall -o server server.c

   Administrator@PIGGY ~/cvsroot/blocktest
   $ ./server.exe
   ret=0|
   recvfrom: Invalid argument
   len=-1|
   recvfrom: Invalid argument
   len=-1|

As my program demonstrated, this certainly does work.

However, as the original poster reports, NONBLOCKING i/o does NOT work.
The call to recvfrom DOES appear to block.

Sorry for the confusion. (Where's my diet coke?) :-)
Keith



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]