In the case of chat application, slow client or TCP timeout may consume very large write buffer.
To write robust application, iostream should support limiting write buffer size.
Add iostream.write_buffer_size property.
Add max_write_buffer_size to iostream.
If this needs to be exposed publicly, I'd rather just make the attribute public instead of having both a semi-private attribute and a public read-only property.
It's odd that this is public but read_buffer_size is not. Do we need a way to inspect the buffer size here in addition to being able to try the write and catch the exception? Keep in mind that we already have another way to manage write buffer sizes via the write callback (although I agree that that is not always suitable and we need some way to detect a stream that is not making sufficient progress).
I just added it for consistency with read_buffer_size.
My real use case is limiting write buffer size to avoid OOM.
Remove `write_buffer_size` read-only property.
I've removed write_buffer_size property.