From owner-freebsd-hackers Wed Mar 31 3:12: 7 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from titan.metropolitan.at (unknown [195.212.98.131]) by hub.freebsd.org (Postfix) with ESMTP id BE1801546B for ; Wed, 31 Mar 1999 03:12:00 -0800 (PST) (envelope-from mladavac@metropolitan.at) Received: by TITAN with Internet Mail Service (5.0.1458.49) id ; Wed, 31 Mar 1999 13:14:01 +0200 Message-ID: <97A8CA5BF490D211A94F0000F6C2E55D097583@s-lmh-wi-900.corpnet.at> From: Ladavac Marino To: 'Graham Wheeler' , hackers@freebsd.org Subject: RE: select() on UDP socket returns ECONNREFUSED Date: Wed, 31 Mar 1999 13:08:33 +0200 X-Priority: 3 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1458.49) Content-Type: text/plain Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > -----Original Message----- > From: Graham Wheeler [SMTP:gram@cdsec.com] > Sent: Wednesday, March 31, 1999 12:09 PM > To: hackers@freebsd.org > Subject: select() on UDP socket returns ECONNREFUSED > > Hi all > > Does anyone know what this means? The source code for select is buried > in some non-obvious place so I haven't been able to check it directly. [ML] I don't parse this. Do you mean, select returns -1 and sets errno to ECONNREFUSED? You know that you should not evaluate errno unless the last operation failed (a successful operation does not clear errno). BTW, the behavior might be correct if you have had a non-blocking connect and it failed. Select then marked the file descriptor readable (select for write on a non blocking connect does not seem to work as advertised in the manpage) and the subsequent read fails with ECONNREFUSED. Please note that failure of a non blocking connect can be reported only on the first use of the descriptor after the state of the descriptor is no longer EINPROGRESS. /Marino > TIA > gram > -- > Dr Graham Wheeler E-mail: gram@cdsec.com > Citadel Data Security Phone: +27(21)423-6065/6/7 > Firewalls/Virtual Private Networks Fax: +27(21)24-3656 > Internet/Intranet Network Specialists > Data Security Products WWW: > http://www.cdsec.com/ > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message