delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/12/28/10:04:19

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
From: Uri Simchoni <uris AT ctera DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Date: Mon, 28 Dec 2009 10:03:46 -0500
Subject: Cygwin 1.7.1-1 - problem with non-blocking socket IO
Message-ID: <DDB181A6E7B893429D83CAC8DDBA74F107206CA231@VMBX108.ihostexchange.net>
x-cr-hashedpuzzle: AKVR BKPk BK0p Bet2 CYNf EQXg FjLY FyF1 GR6U GiK3 Gu+S HCdO H8+u IT0f J5xF LaX0;1;YwB5AGcAdwBpAG4AQABjAHkAZwB3AGkAbgAuAGMAbwBtAA==;Sosha1_v1;7;{B9B2CC8C-DCB4-484B-98B6-8FF597FDEA04};dQByAGkAcwBAAGMAdABlAHIAYQAuAGMAbwBtAA==;Mon, 28 Dec 2009 15:03:46 GMT;QwB5AGcAdwBpAG4AIAAxAC4ANwAuADEALQAxACAALQAgAHAAcgBvAGIAbABlAG0AIAB3AGkAdABoACAAbgBvAG4ALQBiAGwAbwBjAGsAaQBuAGcAIABzAG8AYwBrAGUAdAAgAEkATwA=
x-cr-puzzleid: {B9B2CC8C-DCB4-484B-98B6-8FF597FDEA04}
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--_002_DDB181A6E7B893429D83CAC8DDBA74F107206CA231VMBX108ihoste_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,

I seem to have a problem with non-blocking writes to TCP sockets and unix-d=
omain sockets - they block.

The attached program illustrates it - it creates a socketpair(), sets one e=
nd to non-blocking and writes to it - expecting to get an EWOULDBLOCK. On m=
y system it hangs.

With pipe() it works fine.

Please advise.
Thanks,
Uri


--_002_DDB181A6E7B893429D83CAC8DDBA74F107206CA231VMBX108ihoste_
Content-Type: text/plain; name="nbtest2.c"
Content-Description: nbtest2.c
Content-Disposition: attachment; filename="nbtest2.c"; size=775;
	creation-date="Mon, 28 Dec 2009 09:43:46 GMT";
	modification-date="Mon, 28 Dec 2009 09:55:03 GMT"
Content-Transfer-Encoding: base64

I2luY2x1ZGUgPHN5cy90eXBlcy5oPgojaW5jbHVkZSA8c3lzL3NvY2tldC5o
PgojaW5jbHVkZSA8dW5pc3RkLmg+CiNpbmNsdWRlIDxmY250bC5oPgojaW5j
bHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPGVycm5vLmg+CgojZGVmaW5lIEJB
U0lDX1VOSVQJMTAyNCoxMDI0Ci8vI2RlZmluZSBCQVNJQ19VTklUCTEKY2hh
ciBsYXJnZV9idWZbQkFTSUNfVU5JVF07Cgp2b2lkIGZkX3BhaXIoaW50ICpm
ZCkKewovKglpZihwaXBlKGZkKTwwKQoJCXBlcnJvcigicGlwZSIpOyAqLwoJ
aWYoc29ja2V0cGFpcihBRl9VTklYLFNPQ0tfU1RSRUFNLDAsZmQpIDwwKQoJ
CXBlcnJvcigic29ja2V0cGFpciIpOwp9Cgp2b2lkIHNldF9ub25ibG9ja2lu
ZyhpbnQgZmQpCnsKCWludCB2YWw9ZmNudGwoZmQsRl9HRVRGTCk7CglpZih2
YWw9PS0xKQoJCXBlcnJvcigiZmNudGwiKTsKCXZhbHw9T19OT05CTE9DSzsK
CWZjbnRsKGZkLEZfU0VURkwsdmFsKTsKfQoKaW50IG1haW4oaW50IGFyZ2Ms
Y2hhciAqYXJndltdKQp7CglpbnQgZmRbMl0scmM7CglmZF9wYWlyKGZkKTsK
CSAgCglzZXRfbm9uYmxvY2tpbmcoZmRbMV0pOwoKCXdoaWxlKDEpewoJCXJj
PXdyaXRlKGZkWzFdLGxhcmdlX2J1ZixzaXplb2YobGFyZ2VfYnVmKSk7CgkJ
aWYocmM8MCl7CgkJCWlmKGVycm5vPT1FV09VTERCTE9DSykKCQkJCXByaW50
ZigiYmxvY2tpbmcsIHRoYW5rIHlvdSwgZ29vZGJ5ZS5cbiIpOwoJCQllbHNl
CgkJCQlwZXJyb3IoIndyaXRlIik7CgoJCQlicmVhazsKCQl9Cgl9CgoJcmV0
dXJuIDA7Cn0KCg==


--_002_DDB181A6E7B893429D83CAC8DDBA74F107206CA231VMBX108ihoste_
Content-Type: text/plain; charset=us-ascii

--
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
--_002_DDB181A6E7B893429D83CAC8DDBA74F107206CA231VMBX108ihoste_--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019