delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/12/07:45:30

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3A87DABB.F72D55C0@etr-usa.com>
Date: Mon, 12 Feb 2001 05:44:43 -0700
From: Warren Young <warren AT etr-usa DOT com>
Organization: -ENOENT
X-Mailer: Mozilla 4.74 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Cygwin-L <cygwin AT cygwin DOT com>
Subject: Re: DuplicateHandle() failing under MS Telnet Server
References: <20010212174335 DOT A5323 AT systematik DOT co DOT nz>

Dan Plimak wrote:
> 
> This patently won't work under MS Telnet server as from what I can tell (I
> _may_ be wrong), they are using a kludge where they make a handle from a
> socket fd, which is distinct from a regular Windows resource/file handle and
> hence things that may be done with a handle fail.

This is a "feature" of Microsoft stacks.  You can use DuplicateHandle()
with Winsock 1.1 to do odd things that normally require the new
WSADuplicateSocket() and other new Winsock 2/Win32 functionality.  For a
fuller explanation, there's an article in my FAQ about this, called
"Passing Sockets Between Processes".

This feature could be used to implement dup() or maybe dup2() on Winsock
1.1 systems, but that's basically only Windows 95, so it's of fairly
little value these days.  (Win98+ and NT 4+ have Winsock 2 installed by
default.)
-- 
= Warren Young, maintainer of the Winsock Programmer's FAQ at:
=     http://www.cyberport.com/~tangent/programming/winsock/
= 
= ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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