From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,b21bbb998745e101,start X-Google-Attributes: gidfee84,public From: Bob Wells <100272.3004@CompuServe.COM> Subject: send() does not work with sockets and select()! Date: 1995/09/12 Message-ID: <434lgd$1vo$1@mhade.production.compuserve.com>#1/1 X-Deja-AN: 109983588 organization: CompuServe, Inc. (1-800-689-0736) newsgroups: comp.unix.osf.osf1 G'day, I am using stream sockets to implement an IPC mechanism for our application here. The mechanism is to use non/blocking I/O on the sockets (set via a call to fcntl() which does not report any errors.) The descriptors are then hung into various fd_sets using the relevent FD_* macros and these are then passed to a select statement. We have a problem in that select returns and says that we can write to a specific socket. But when we go to the socket and attempt a send() call we get back an error and errno is set to EWOULDBLOCK! So the select statement does not seem to be telling the "exeact" truth about the situation. Upon closer inspection, it appears that select() tells us we can write to a socket , but if what I have to write is larger than the space currently  available in its buffer then we return EWOULDBLOCK. If what I have to write is less than the space available then I am able to write the data away!  I was expecting that the call to send() would return a positive value giving the number of bytes it was able to write away. But this appears to not be the case. Am I missing something here? BTW The sockets are created using AF_INET and the defauklt protocol selected. The default buffer size is being used. SO_REUSEADDR is being set along with non-blocking I/O. Any help would be truly appreciated! -- Bob W. (-: "Amazing dyslexia for cure found."