X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; q=dns; s=default; b=pxzbUdD2/Ud3uY3CdgOsuVgc78Snquwhf8C+jeVBYPY cK9y2fojwbhUphUxunM95KH26f6tAoUEMtPAAhj9LLe9JEc4lmLUpJO+oaJEg1nA 9mgKJFTbgkhR+PvjY5sEkibFr5woaWeZNwOt8W5AnGENjTiC1ukOKtIpFl+/Lmco = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; s=default; bh=e/ORctbihB2zGjPGMcRRrhcCj7Y=; b=NKCJbK2puXevQ200h x46awnfypEysFMyJosJ81tvkGE4DYMUhm+QlBKh8d0Odj+zDECgiTIEX+dAM84LE 6V+DdEEOAzrXqA+ImsQOxrx5c2NuE1v3Vdb2pBhZCQF4U5KMAl0paCOUvgDuATjT 9aDpgiPYSdsLDEUgT5RcT/dIWA= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=UD:Please, Gratz, gratz, sk:stromek X-HELO: mail-io0-f174.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=8rmRrETgBuB44N+9jMhULueWUfZ6RcpWz2S4P3oPi1s=; b=Nluailj2oU9F2y4NM8u5MCOeko18o0nUJVBCb6enyJw7Z2LftkQAJ2JY+IUpk489Pm 3N8Rtd0nc6kc5LlqAq/azrOJqUWkuxCUlLcLsuR2kaKivv4LX03y/i483/VnigRaPvxe Or3/Xu1qFpi7mNhcc4vrXKfleIwzrnJiwLmJFNsLqOFxNGBBgt5CdF+AoTqJh2LiEHOy EnCav8PQV4pBaJlIXCsjfW2dvVINH2eFyaE2TfpEJsoJumW7bnf6jDrUk0Ng9I0QbBbq Cu1OODQPMdo6xTH+khNm3AajcnYiPGSMFTxG65uFgH+LmVh+WBP+6o31GroJgBTRzT25 tEWA== X-Gm-Message-State: AEkoousIAKFJEB9ouU4PMmNMAa2uVxgFlw/LICHPzLHlSTTDGKj9TEGOFgHcmZOfOxVJWyN/jblIWgSyaVNKmw== X-Received: by 10.107.28.11 with SMTP id c11mr43158002ioc.7.1471321069589; Mon, 15 Aug 2016 21:17:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <87ziod26wx.fsf@Rainer.invalid> References: <87ziod26wx DOT fsf AT Rainer DOT invalid> From: Pankaj Yadav Date: Tue, 16 Aug 2016 09:47:49 +0530 Message-ID: Subject: Re: On WIN7, write() not returning immediately even on non-blocking sockets To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u7G4IBTa013491 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->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. > > > Regards, > Achim. > -- > +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ > > Factory and User Sound Singles for Waldorf rackAttack: > http://Synth.Stromeko.net/Downloads.html#WaldorfSounds > > -- > 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 FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple