Re: How big is socket receive buffer, and how to control it?




C. J. Clegg wrote:
If I use send() on one Linux box to send data to a socket on another
Linux box and use recv() to read the data, how large is the buffer on
the destination box, i.e. how much stuff can I send it before it
overflows or blocks and refuses to take any more?

There is a situation where the receiving host may not get around to
reading the data with recv() for a while.

Then there is nothing in the receive buffer.

Is there a way to control the size of the receive buffer, perhaps a
configuration parameter or even a change to a header file and a
recompile of the kernel?

man 7 socket
search for SO_SNDBUF and SO_RCVBUF

.



Relevant Pages

  • How big is socket receive buffer, and how to control it?
    ... Linux box and use recv() to read the data, how large is the buffer on ... There is a situation where the receiving host may not get around to ...
    (comp.os.linux.networking)
  • Re: Data loss appending data to file
    ... In this example, the destination is 8000 ... the source is 2000 bytes and the buffer is 32768 bytes. ... > SetFilePointer(destHandle, 0, nil, FILE_END); ... If we don't flush cache before closing file, ...
    (microsoft.public.win32.programmer.kernel)
  • Re: BSD sockets: recv with MSG_WAITALL should return EWOULDBLOCK?
    ... (I am not convinced it is much use for blocking sockets ... many bytes as the size argument to recv() or to close the connection ... And this sounds like 'if you are using a buffer size that doesn't ... Another frame arrives and more data is queued to the socket buffer. ...
    (comp.unix.programmer)
  • Re: TdiBuildReceive question
    ... Irp->IoStatus.Information < the size of the buffer. ... then it is better to fill it as much as possible, and not complete the recv() ... To prevent such a time loss, the TCP protocol has a PSH bit ... PSH means - "the sender does not know when the next bytes will ...
    (microsoft.public.development.device.drivers)
  • Re: recv WSAENOBUFS error
    ... cross-posting, I did cross-post it initially, but I just started using ... it always asks for the "packet length" amount in the call to recv. ... You can set kernel-mode buffer with setsockopt but you'll quickly finish ...
    (microsoft.public.win32.programmer.kernel)