[Bug 260114] [sctp] SO_SNDLOWAT is not accounted for when sending data
Date: Tue, 30 Nov 2021 23:16:48 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260114 --- Comment #2 from Albin <albin.hellqvist@ericsson.com> --- I think that I have misinterpreted the SO_SNDLOWAT functionality and provided a faulty/misleading example. To quote SO_SNDLOWAT again from the man: "Nonblocking output operations will process as much data as permitted subject to flow control without blocking, but will process no data if flow control does not allow the smaller of the low water mark value or the entire request to be processed." Also, I don't know why I made the comment about blocking, since blocking is blocking, it will just block until all data has been buffered. I probably had too much in my head since I submitted many bugs at once :) Anyway, I get it as one of the uses for SO_SNDLOWAT is to be able to guarantee buffering of entire "messages". For example, let's say that I have a SCTP socket which is message based. I know that the largest message I want to be able to send is 8192 bytes so I set SO_SNDLOWAT to this value. Now, let's say that I have some congestion and my send buffer only has 2048 bytes free. Then I shouldn't be able to send any 8192 bytes messages, not even parts of them. Not until the send buffer has at least 8192 bytes free. But I guess that I should be able to send a message of 512 bytes still? Since then the full message can be buffered. -- You are receiving this mail because: You are the assignee for the bug.