[comp.sys.hp] Non-blocking I/O

bailey@mcs.kent.edu (Jeff Bailey) (11/10/90)

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)      <bailey@mcs.kent.edu>
Department of Mathematics and Computer Science
Kent State University
Kent - OH 44242

bailey@mcs.kent.edu (Jeff Bailey) (11/10/90)

Aw sh*t! I meant FNBLOCK in that last post. Not FNDELAY. I know FNDELAY
acts differently. I can switch though if it'll really work that way.
---------------------------------------------------------------------
Jeff Bailey (JRB71) (System Administrator)      <bailey@mcs.kent.edu>
Department of Mathematics and Computer Science
Kent State University
Kent - OH 44242