Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!pacbell.com!decwrl!shelby!eos!data.nas.nasa.gov!eagle!usenet.ins.cwru.edu!mcs.kent.edu!news From: bailey@mcs.kent.edu (Jeff Bailey) Newsgroups: comp.sys.hp Subject: Non-blocking I/O Keywords: Writev doesn't return correct value Message-ID: <1990Nov10.121002.19129@mcs.kent.edu> Date: 10 Nov 90 12:10:02 GMT Sender: news@mcs.kent.edu (News Administrator) Reply-To: bailey@mcs.kent.edu Organization: Computer Science Dept., Kent State Univ. Lines: 22 I've been having a problem with non-blocking I/O on a socket under 7.0 on a 300 series. I have a socket which has the FNDELAY flag set. I then do a writev (or write, but the writev is what I'm really after). If there is enough room to write everything without blocking it works fine. If there is room for only part of the data though it doesn't work as it should. According to the manual it should either write nothing and return -1 with errno = EAGAIN or write what it can and return the number of bytes written. Despite what the manual says, it seems to write what it can and then return the -1 and set errno anyway! I then resend the whole thing, of course. I end up with the first part of my data being written multiple times until I get lucky and catch the buffer when it has enough room to hold everything. Am I totally misunderstanding the semantics of nonblocking sockets of is this a known bug? I find it difficult to believe that something this drastic could have slipped past the QC people so it must be something I'm doing. I can't for the life of me figure out what though. --------------------------------------------------------------------- Jeff Bailey (JRB71) (System Administrator) Department of Mathematics and Computer Science Kent State University Kent - OH 44242