Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!linus!nixbur!nixpbe!peun11!josef From: josef@nixdorf.de (Moellers) Newsgroups: comp.unix.internals Subject: Re: question on select() and sockets Message-ID: Date: 16 Nov 90 07:16:39 GMT References: Sender: news@nixpbe.nixdorf.de Lines: 30 In abdik@cat.syr.EDU (Ahmad Dik) writes: >I would like to know if select() can be used to find out if there is >a blocked read on a socket. >In other words, will the second parameter of the select() function >tell me if the socket's buffer is empty, and I can write to it, or >does it tell me that there is someone blocked trying to read from the socket. >If select can not be used to tell if anyone is blocked reading on a >socket, is there any other way I can find out ?? The second parameter tells You if You can write to the socket. That does not mean that the buffer has to be empty, just that there is enough room to accomodate a write(). It doesn't tell You how much You'll be able to write. Needless to say: it's a vector with a bit for each fd. To my knowledge there is no way of telling if anyone is blocked on the other end of a connection as 1. the "other party" might be on a different machine far far away 2. the "other party" might not even be a UNIX box that knows what a "process" is or how one can "block". -- ======= | Josef Moellers | c/o Siemens Nixdorf Informatonssysteme AG | | USA: mollers.pad@nixdorf.com | Abt. PXD-S14 | | !USA: mollers.pad@nixdorf.de | Heinz-Nixdorf-Ring |