On WIN7, write() not returning immediately even on non-blocking sockets
Tue Aug 16 09:12:00 GMT 2016
On Aug 16, 2016 12:31 AM, "Achim Gratz" <Stromeko@nexgo.de> 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->webtoresplen-t_qelem->webtorespsent);
> > printf("written\n");
> > Output is : Non-blocking:1 and then it does NOT print "written" ever.
> You'd have better chances of getting help if you could come up with a
> minimal program that exhibits the error.
I will try my best but it sounds very hard to isolate a minimal
program which will exhibit the issue.
But one thing is pretty clear, write() shouldnt block for long on a
non-blocking socket.Please tell me if there are any situation unknown
to me in which write on non-blocking socket can block and keep
countinuously calling fhandler_socket::wait_for_events() and waiting
forever. And its happening only on win7 not any other os.
> +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
> Factory and User Sound Singles for Waldorf rackAttack:
> Problem reports: http://cygwin.com/problems.html
> FAQ: http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin