Re: On WIN7, write() not returning immediately even on non-blocking sockets

2016-08-15 Thread Pankaj Yadav
On Aug 16, 2016 12:31 AM, "Achim Gratz" wrote: > > Pankaj Yadav writes: > > The code where it gets stuck is > > > > printf("Nonblocking:%d\n",(fcntl(t_qelem->respsock, F_GETFL, 0) & > > O_NONBLOCK))?1:0; > > i = > > write(t_qelem->respsock,&t_qelem->webtoresp[t_qelem->webtorespsent],t_qelem->webt

Re: On WIN7, write() not returning immediately even on non-blocking sockets

2016-08-15 Thread Achim Gratz
Pankaj Yadav writes: > The code where it gets stuck is > > printf("Nonblocking:%d\n",(fcntl(t_qelem->respsock, F_GETFL, 0) & > O_NONBLOCK))?1:0; > i = > write(t_qelem->respsock,&t_qelem->webtoresp[t_qelem->webtorespsent],t_qelem->webtoresplen-t_qelem->webtorespsent); > printf("written\n"); > > Out

On WIN7, write() not returning immediately even on non-blocking sockets

2016-08-15 Thread Pankaj Yadav
Hi, We have a proxy server type of program which has an infinite loop writing to sockets with write() call. All of the sockets are set to non-blocking mode.It works fine on linux and all windows versions except win7(both 32 and 64 bit).We tested on hundreds of computers. The code where it gets st