« Return to Thread: Socket inheritance with fork/dup2/exec

Re: Socket inheritance with fork/dup2/exec

by Lev Bishop :: Rate this Message:

Reply to Author | View in Thread

On 6/22/07, Corinna Vinschen wrote:

> However, the next version of Cygwin will use standard DuplicateHandle
> calls as for normal file handles.  Consequentially your
> your test application appears to work with a Cygwin built from CVS:

But MSDN says:
 You should not use DuplicateHandle to duplicate handles to the
following objects:

     * I/O completion ports. No error is returned, but the duplicate
handle cannot be used.
     * Sockets. No error is returned, but the duplicate handle may not
be recognized by
 Winsock at the target process. Also, using DuplicateHandle interferes
with internal reference  counting on the underlying object. To
duplicate a socket handle, use the
 WSADuplicateSocket function.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

 « Return to Thread: Socket inheritance with fork/dup2/exec