Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Mon, 31 Dec 2001 18:18:45 -0500 From: Chris Faylor To: cygwin AT cygwin DOT com Cc: Nicholas Clark Subject: Re: UDP socketpair for cygwin Message-ID: <20011231231845.GA3260@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com, Nicholas Clark References: <20011231212520 DOT C1141 AT Bagpuss DOT unfortu DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011231212520.C1141@Bagpuss.unfortu.net> User-Agent: Mutt/1.3.23.1i Please check out the project web page for links to available information and ports: http://cygwin.com/ . If you don't see what you need there, then the cygwin mailing list is the best place to make observations or get questions answered. Information on the mailing list is available at the project web page. For your convenience, I've reset the Reply-To: address to point to the cygwin mailing list. I've also Cc'ed this reply there. On Mon, Dec 31, 2001 at 09:25:21PM +0000, Nicholas Clark wrote: >Sorry if I have found the wrong addresses to e-mail, but as best I can figure >out from the MAINTAINERS file you're the people maintaining >winsup/cygwin/net.cc. > >I'm not a Cygwin user, but one of the contributors to perl5, and perl5 is >getting test built by other people who are using Cygwin (and native Windows) >Because of something else Win32 related I volunteered to write a socketpair >emulation for Win32, and after I wrote stream sockets using TCP worked out >an easy way to do datagram sockets using UDP. I also wrote a perl regression >test for socketpair that passes on real socketpair on Unix (except for HP >UX, but we've concluded that their stack is very buggy w.r.t shutdown()) > >I was surprised to find that the test was failing 50% on Cygwin. I'd assumed >that my emulation code was duff (because I'd been told that Win32 had no >socketpair, and assumed therefore that development perl built on Cygwin was >using my emulation code. [It's being tested by someone in Amsterdam; I'm in >London, so it's not possible for me to pop round and look over his shoulder >at the console] > >After a few days of head scratching we thought to check things and found that >Cygwin has socketpair emulation code. I've got the Cygwin source from CVS, and >indeed it does in winsup/cygwin/net.cc, but only for stream sockets. > >To cut a long story short, I'm attaching my emulation code for TCP and UDP >socketpairs for Cygwin's use, should you want it. It's currently in the form >of a hello world program, which has been compiled and run on Cygwin last week >(but has had 1 errno related bug fixed since then, which shouldn't bust it) > >My TCP code appears to be slightly more paranoid that Cygwin's, but otherwise >similar. Cygwin's doesn't attempt UDP, but it would not be difficult to add, >basically by chopping out my S_socketpair_udp and placing it in net.cc >As I don't have any machine running MS Windows, let alone a Windows machine >with a compiler I can't do this for you - sorry. > >However, I hope this code is of use to you. Is it large enough that there >needs to be some sort of copyright assignment games for legal reasons? > >Nicholas Clark > -- cgf AT redhat DOT com Red Hat, Inc. http://sources.redhat.com/ http://www.redhat.com/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/