This is the mail archive of the
cygwin
mailing list for the Cygwin project.
cygwin_attach_handle_to_fd and SOCKET.
- From: "Christophe LEITIENNE" <c dot leitienne at remove dot this dot bgpartners dot fr>
- To: "Cygwin mailing list" <cygwin at cygwin dot com>
- Date: Mon, 25 Oct 2004 14:09:13 +0200
- Subject: cygwin_attach_handle_to_fd and SOCKET.
I'm using cygwin_attach_handle_to_fd to attach a windows SOCKET to a cygwin
file descriptor.
I do it this way:
fd = cygwin_attach_handle_to_fd("/dev/tcp", -1, WindowsSocketHandle, TRUE,
GENERIC_READ|GENERIC_WRITE);
This call works well under Cygwin 1.3.13, and calls to recv(fd,...) or
send(fd,...) also works correctly.
Under the last version of Cygwin (1.5.11), cygwin_attach_handle_to_fd still
works, but calls to recv() fails with errno 108 (ENOTSOCK - Socket operation
on non-socket).
I guess the "name" argument I provide to cygwin_attach_handle_to_fd
("/dev/tcp") is wrong under 1.5.11.
I had a look at the sources (especially dtable.cc), but did not found any
clues.
Does anyone knows what "name" argument I should use ?
Thanks.
--
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/