delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2002/07/04/10:11:24

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT cygwin DOT com
Delivered-To: mailing list cygwin-developers AT cygwin DOT com
Date: Thu, 4 Jul 2002 16:11:16 +0200
From: Corinna Vinschen <vinschen AT redhat DOT com>
To: cygwin-developers AT cygwin DOT com
Subject: Re: Interruptable connect
Message-ID: <20020704161116.U21857@cygbert.vinschen.de>
Reply-To: cygwin-developers AT cygwin DOT com
Mail-Followup-To: cygwin-developers AT cygwin DOT com
References: <Pine DOT WNT DOT 4 DOT 44 DOT 0207041420180 DOT 250-100000 AT algeria DOT intern DOT net> <Pine DOT WNT DOT 4 DOT 44 DOT 0207041449070 DOT 141-100000 AT algeria DOT intern DOT net>
Mime-Version: 1.0
In-Reply-To: <Pine.WNT.4.44.0207041449070.141-100000@algeria.intern.net>
User-Agent: Mutt/1.3.22.1i

On Thu, Jul 04, 2002 at 02:54:44PM +0200, Thomas Pfaff wrote:
> > Sure, but how will this help ? You can not look ahead if the connect will
> > be reentered or not. If the program is well written it will or close the
> > socket afterwards, but should i rely on this ?
> >
> 
> To be more precise:
> I have no problems with unclosed sockets but with a connected socket
> that shouldn't be connected.

I see.  The question is if we're able to get around that Winsock'ism.

Perhaps Winsock2 helps a bit.

This is just brainstorming, I have no idea if that works:

When connect is called, create a duplicate of the socket first,
before actually connecting, using the WSADuplicateSocket call.
This should give you a structure describing the socket in exactly
the state before the ::connect call.  Now for the cases:

- Normal connect, success, erase the duplicate.
- Normal connect, failure, ditto.
- Interrupt, close original socket and recreate it from the duplicate
  using WSASocket.

Would that work???

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

- Raw text -


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