This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Cygwin select + sockets from DLL


--- Peter Hudson +44 1892 541 720 <peter@telnet-research.co.uk> wrote:
> Hello
> 
> I am trying to use a B20.1 select call to wait for a read event
> on a socket, but the select never returns. This socket was created
> by a DLL that is not mine.
> 
> The socket has a file descriptor value of a number greater than 63.
> Hence when a use FD_SET to create the read mask for the select,
> there aren't enough bits in the mask. The mask just remains as 0,0 ,
> which is why the select doesn't return.
> 
> In sys/types.h I can see:
> #       define  FD_SETSIZE      64
> 
> which is why my file descriptor values do not fit in an fd_mask.
> 
> I can also see the comment in this file:
> "We don't define fd_set and friends if we are compiling POSIX
>    source, or if we have included the Windows Sockets.h header (which
>    defines Windows versions of them).  Note that a program which
>    includes the Windows sockets.h header must know what it is doing;
>    it must not call the cygwin32 select function."
> 
> I am not including the Windows sockets.h header, nor does the
> header file for the DLL include it. But presumably the DLL does
> use winsock-allocated sockets. Do I gather that I can't use these
> sockets with Cygwin select?
> 
> I am doing something wrong, or is there a way round this problem?
> 

Well, unless the third party software uses cygwin1.dll (which I doubt), then
based up the quoted comments you can't use the Cygwin select.  You must use the
Windows sockets.h header and function set.

=====
Earnie Boyd <mailto:earnie_boyd@yahoo.com>
Cygwin Newbies, please visit
<http://www.freeyellow.com/members5/gw32/index.html>
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]