Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <37BDD253.2109E564@mindless.com> Date: Fri, 20 Aug 1999 16:10:27 -0600 From: "joshua M. Schmidlkofer" X-Mailer: Mozilla 4.61 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: cygwin AT sourceware DOT cygnus DOT com Subject: Re: cygwin32 and select() References: <37BDB1CD DOT BD7FB4EF AT mindless DOT com> <19990820171317 DOT A6337 AT cygnus DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Actually, I do not mean to be in any way offensive, or anything like that. I have been investigating the problem, and have not found resolution. I would like to emphasize 'seems'. I am a big time linux user, and I beleive in free software. I also understand the development process, and that occasionally somone misunderstands an API, etc. I am writing a little udp library to do some dirtywork for my other interests. It's simply job is to send, receive, and listen for data on a given port. I am writing it to be relativley flexible, but targetted to basic UDP communications. This code allows me to do that. In the example have a single socket open, and am waiting for data to come in on it. The following are a couple snippets. The code is availible @: http://www.cyberhighway.net/~iwpsrci/sockets/code.tar Inside are the gzip'd files. [yes I know, tar the files, and gzip the tar] Oh well, the code works find on Linux, however, it does not work on cygwin. The timing in select() is perfect, and it seems normal however, one question remains. When I was trying to learn about select() I found the two differing explainations, in differnt man pages: Man page 1: int select(int numfds, fd_set *readfds, fd_set *writefds , fd_set *exceptfds, struct timeval * timeout); ^^^^^^ This leads me to beleive that I put the number of fd's that I have in select() However, this is from the most recent man pages that I have found: Man Page 2: int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); [.....] n is the highest-numbered descriptor in any of the three sets, plus 1. This could be my problem, but still.... select() IS working under Linux 2.2 Just for info, here is me structure, so you know what's up. ... typedef struct { int fd; struct sockaddr_in sa, sout, sinlast; struct timeval tv; fd_set fds; int max_bufsize; } SOCKET_TYPE; ... here is the routing that calls select: ... int socket_listen (SOCKET_TYPE * st, struct timeval *tv){ struct timeval t_tv; if (tv==NULL) tv=&t_tv; memcpy(tv, &(st->tv), sizeof(struct timeval)); return select ((st->fd + 1), &(st->fds), NULL, NULL, tv); } ... This returns '0' everytime. If I remove select I can get the data, or at least, a udp comm utility that I wrote will get the data. thanks, Joshua Chris Faylor wrote: > > On Fri, Aug 20, 1999 at 01:51:41PM -0600, joshua M. Schmidlkofer wrote: > >I am looking for more information with using select(), and cygwin32. > >So far select() seems completely broken, at least for read fd's.. Did > >I miss a 'to be developed' page? > > Perhaps if you provided more information than "completely broken" > somebody *might* be able to answer this question. > > -chris -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com