From: Bob Wells <100272.3004@CompuServe.COM>
Subject: send() does not work with sockets and select()!
Date: 1995/09/12 [thread overview]
Message-ID: <434lgd$1vo$1@mhade.production.compuserve.com> (raw)
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.\x7f) 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 \x7f
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! \x7f
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\x7f\x7f
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."
reply other threads:[~1995-09-12 4:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox