Closed wiboticalex closed 2 years ago
@wiboticalex can you please run Black to fix the formatting? This should get merged automatically afterward.
Done. Thought I could get away with moving code around and not reformatting, but apparently not :slightly_smiling_face: .
Thanks @pavel-kirienko
This is a followup to issue #233.
Avoid ENOBUFS OSErrors by shrinking the size of SNDBUF when appropriate.
Similar behavior could have probably been achieved by simply setting the socket's SNDBUF to 0 to get whatever Linux sets as the minimum, but it seems like this may cause potential queue under-utilization when there are large queues specified, so this pull request tries to calculate (with a very rough approximation for sk_buffer struct size) what the minimum SNDBUF should be to get blocking behavior.