On 2004-01-08, Prasad Venkata Boddupalli <(E-Mail Removed)> wrote:
> Hello,
>
> If I open a streams socket with the non-blocking option and write it to
> it, the data from the application buffers get copied to the socket buffers
> and return immediately (assuming there is space in the socket buffers).
> However that data has to be sent down the stream. Which component of the
> kernel does that and how often is that scheduled ?
So are you using the Streams API, or the Sockets API?
Or do you mean stream as is stdio stream?
If you're talking about stdio, then I offer you this advice.
DO NOT USE STDIO WITH SOCKETS. Sorry to shout, but that's a very
important lesson, and one that is painfully learned. (It has to do with
buffering)
As to your question, stdio is not part of the kernel, so is not handled
by it. stdio will flush the stream depending on its buffering mode, the
default being fully-buffered, which is about 4k bytes. Other buffering
options are line-buffered and unbuffered. A buffer will be flushed when
it gets full, or you call fflush(3).
But keep in mind that you shouldn't be doing this anyway. You should
only use the file-descriptor based functions when dealing with network
sockets, thats read/recv, write/send, recvmsg/sendmsg, readv/writev.
Its a bit of a pain, but that's what you have to do in C.
You might have better results asking your question in
comp.os.linux.development.system
--
Cameron Kerr
(E-Mail Removed) :
http://nzgeeks.org/cameron/
Empowered by Perl!