Re: Send socket buffer size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

> write a byte at a time, I manage to write 118785 bytes, 66525 of which
> are in the recv buff (why not 87380?),

Because rcvbuf and sndbuf have indirect relation to bytes
which you write. It measures amount of memory which socket
is allowed to consume.

Taking into account your write pattern it is even surprizing
that values are so close to hints.


>				 52260 in the send buffer.  Notice
> that 52260 > 49440.

Because sndbuf is rounded up to hold integer amount of segments
and you have gratuious mtu sized bonus.


>   Running the same test on FreeBSD exhibits the behavior you'd expect,

It depens on taste. :-) Knowing internals of protocol a bit,
I would not expect such behaviour and find it very strange, for example.
Application knows much better how much bytes it sent and received
and for tcp these numbers have no meaning at all: it needs only allocated
resources (for memory management) and data which are in network
(to control network load) are.

> kernel at one end, but not yet read by the other end.

I am afraid, kernel is not able to help with this.

Alexey
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux