Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!marque!gryphon!sarima From: sarima@gryphon.CTS.COM (Stan Friesen) Newsgroups: comp.unix.wizards Subject: Re: Help with select Message-ID: <2958@gryphon.CTS.COM> Date: 21 Mar 88 00:11:04 GMT References: <12404@brl-adm.ARPA> Reply-To: sarima@gryphon.CTS.COM (Stan Friesen) Organization: Trailing Edge Technology, Redondo Beach, CA Lines: 21 In article <12404@brl-adm.ARPA> doug@ws5.cis.temple.edu (Doug Bagley) writes: >I am trying to learn how to use sockets in Ultrix 2.0 at a site with no >sources. My problem is with the select function. When I provide the >readfds and writefds parameters to the select function, only the writefds >parameter gets changed whether or not the process on the other end of the >socket is doing a read or a write. Strangely enough, if I make the >writefds NULL or 0, and if the remote process is only writing to this >one, everything works fine -- the remote process' writes show up in the >readfds (telling the selecting process that it can read). I think you may have a sligght misunderstanding of what a select() on a write fd means. It means block until there is enough system buffer space to successfully complete a write on the fd. Since it is almost always true that there is sufficient buffer space for a write to succeed a select() on a writefds will almost always return immediately with the writefds altered. I suspect what you want is to wait until the consumer has read what you last wrote. This is rather difficult to do, and I will not go into it here. SIGH, select() may well be the BSD feature that I miss the most on System V UNIX. Does Sys 5 release 3 have it or its equivalent?