Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!sco!mikep From: mikep@sco.COM (Mike Patnode) Newsgroups: comp.windows.x Subject: FIONREAD on a closed connection Message-ID: <7523@scolex.sco.COM> Date: 21 Aug 90 08:30:43 GMT Sender: news@sco.COM Reply-To: mikep@sco.COM (Mike Patnode) Distribution: na Organization: The Santa Cruz Operation, Inc. Lines: 32 It looks to me like BytesReadable() in Xlibos.h (AKA: FIONREAD) is expected to return -1 if the connection is closed. In Lachman TCP/IP this isn't so, and I can't find anything that says it should. I also took a quick look at the BSD 4.3 kernel, and I couldn't find it being done there. Now this may not be a problem at all. Xlib may check the return value of BytesReadable() just for a sanity check, but it looks to me like _XEventsQueued() is expecting this to be an indicator of the connection status. So this leads to a few questions: What are the functional specs for BytesReadable()? If a connection is broken, when and how should a client find out? Does anybody's FIONREAD return -1 on a closed connection? And the bonus question: Does anybody know what I_NREAD is supposed to do when there is a M_HANGUP on the stream? (Take a wild guess at the answer I want) -- Mike Patnode The Santa Cruz Operation SCO Software Engineer 400 Encinal Street {ucscc,uunet}!sco!mikep mikep@sco.COM P.O. Box 1900 (408) 458-1422 Santa Cruz, CA 95061