Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-22 Thread Paolo Bonzini
On Thu, Apr 21, 2011 at 22:17, Bastien ROUCARIES wrote: > What give FILE_MODE_INFORMATION query using NtQueryInformationFile on > (Handle) Socket ? http://msdn.microsoft.com/en-us/library/cc232119%28v=prot.10%29.aspx Nothing related to blocking/nonblocking state. That's done in the guts of win

Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-22 Thread Ray Satiro
> Really nice to see that, ntdeviceiocontrol thread could be put in > alertable state and thus safely stopable by an APC. APC to stop? Do you mean call WSAIoctl and then use an APC to terminate the thread? I don't think that would be safe and I assume there would remain a pending operation if

Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-21 Thread Bastien ROUCARIES
On Thu, Apr 21, 2011 at 8:59 AM, Ray Satiro wrote: >> On Wed, Apr 20, 2011 at 7:17 PM, Bastien ROUCARIES >>  wrote: >> >> Is the gnulib select() only intended to be used with  nonblocking sockets > on >> >> windows? >> > >> > I have just tested  the program at the end of the file, it thread is >>

Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-21 Thread Bastien ROUCARIES
On Thu, Apr 21, 2011 at 8:59 AM, Ray Satiro wrote: >> On Wed, Apr 20, 2011 at 7:17 PM, Bastien ROUCARIES >>  wrote: >> >> Is the gnulib select() only intended to be used with  nonblocking sockets > on >> >> windows? >> > >> > I have just tested  the program at the end of the file, it thread is >>

Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-21 Thread Paolo Bonzini
On 04/21/2011 12:15 AM, Bastien ROUCARIES wrote: Another one is to use http://www.codeproject.com/KB/threads/QueueUserAPCEx_v2.aspx A kernel driver for this? Hmm... Paolo

Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-20 Thread Ray Satiro
> On Wed, Apr 20, 2011 at 7:17 PM, Bastien ROUCARIES > wrote: > >> Is the gnulib select() only intended to be used with nonblocking sockets on > >> windows? > > > > I have just tested the program at the end of the file, it thread is > > blocked when enable =0 (block socket) and enable=1 it fa

Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-20 Thread Bastien ROUCARIES
>> Spawning a process just to learn if a socket is blocking?  Wow. >> >> Sounds like caching the information independently (like we already do >> for dirfd) is the way to go then, so that we only have to spawn when >> inheriting sockets through stdin/out/err. > > > That is the idea But at least

Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-20 Thread Bastien ROUCARIES
On Wed, Apr 20, 2011 at 11:53 PM, Eric Blake wrote: > On 04/20/2011 03:46 PM, Bastien ROUCARIES wrote: >> On Wed, Apr 20, 2011 at 7:17 PM, Bastien ROUCARIES >> wrote: Is the gnulib select() only intended to be used with nonblocking sockets on windows? >>> >>> I have just tested the prog

Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-20 Thread Eric Blake
On 04/20/2011 03:46 PM, Bastien ROUCARIES wrote: > On Wed, Apr 20, 2011 at 7:17 PM, Bastien ROUCARIES > wrote: >>> Is the gnulib select() only intended to be used with nonblocking sockets on >>> windows? >> >> I have just tested the program at the end of the file, it thread is >> blocked when enab

Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-20 Thread Bastien ROUCARIES
On Wed, Apr 20, 2011 at 7:17 PM, Bastien ROUCARIES wrote: >> Is the gnulib select() only intended to be used with nonblocking sockets on >> windows? > > I have just tested the program at the end of the file, it thread is > blocked when enable =0 (block socket) and enable=1 it fail with > WSAEWOULD

Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-20 Thread Bastien ROUCARIES
> Is the gnulib select() only intended to be used with nonblocking sockets on > windows? I have just tested the program at the end of the file, it thread is blocked when enable =0 (block socket) and enable=1 it fail with WSAEWOULDBLOCK So i possible stragegy will be: 1. createathread TID from par

Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-19 Thread Bruno Haible
Hi Ray, > Is the gnulib select() only intended to be used with nonblocking sockets on > windows? Certainly not. The unit test (tests/test-select.c) tests both the blocking as well as the non-blocking socket case. > Wget uses sockets that are typically blocking, but > on return from rpl_select(

Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-19 Thread Bastien ROUCARIES
Need to test but it seems I have something: SIO_ADDRESS_LIST_CHANGE (opcode setting: V, T==1) To receive notification of changes in the list of local transport addresses of the socket's protocol family to which the application can bind. No output information will be provided upon completion of thi

Re: blocking socket is nonblocking after calling gnulib select() in windows

2011-04-19 Thread Bastien ROUCARIES
On Tue, Apr 19, 2011 at 7:33 AM, Ray Satiro wrote: > Hi, > > > Thank you all for your continuous work on gnulib. Every time I look at it it's > evolving. > > Is the gnulib select() only intended to be used with nonblocking sockets on > windows? The Wget project has recently switched to gnulib's re

blocking socket is nonblocking after calling gnulib select() in windows

2011-04-19 Thread Ray Satiro
Hi, Thank you all for your continuous work on gnulib. Every time I look at it it's evolving. Is the gnulib select() only intended to be used with nonblocking sockets on windows? The Wget project has recently switched to gnulib's replacement select function in their dev builds. Wget uses sock