TCP/IP Sockets Send and Receive Buffer size

Hello,
Could any one tell me the default sizes for send and receive buffers for TCP sockets in QNX (version 6.3.0 service pack 3)?

and does this size change between tiny TCP/IP stack and NetBSD TCP/IP stack?

Thanks for your help in advance!

Best Regards.

Don’t know what they are, but any application that rely on this is broken. TCP is a stream protocol

In
qnx.com/developers/docs/6.3. … ckopt.html
This is the information that confused me:

SO_RCVBUF and SO_SNDBUF
level: SOL_SOCKET

Gets or sets the normal buffer sizes allocated for output (SO_SNDBUF) and input (SO_RCVBUF) buffers. You can increase the buffer size for high-volume connections, or decrease it to limit the possible backlog of incoming data. The system places an absolute limit on these values and defaults them to at least 16K for TCP sockets.
<<<<<<<<<<<<<<<<<
so buffer sizes seem to be 16K by default. But what is the advantage of decreasing buffer size to limit the possible backlog of incoming data?
Thanks.

Oburak,

Increasing the size of the send buffer reduces (not eliminates) the chance that a send() call returns with the number of bytes sent being less than you tried to send. When that case happens (send returning less bytes sent than you requested be sent) you have to have logic to re-send just the bytes that didn’t get sent.

Increasing the size of the receive buffer reduces the chance that a packet arriving from a remote machine gets dropped (forcing the remote side to re-send as part of internal TCP/IP logic or be lost forever in the case of UDP) if your app hasn’t read the buffered data from the TCP/IP stack.

QNX has an upper limit of 196K (I found this by expirmentation).

Tim

Thanks Tim.
so the only good thing about decreasing the receive buffer size is to conserve memory?

Oburak,

Correct.

Unless you are on an extremely limited system it doesn’t make sense to reduce the buffer. In fact I habitually set mine to 196K simply because I have 1 Gig of RAM on my PC104 boards.

Tim