Closed daniel-abramov closed 1 year ago
That should probably be configurable? I don't think TCP_NODELAY
is always the right choice. See e.g. recent https://withinboredom.info/blog/2022/12/29/golang-is-evil-on-shitty-networks/ , or just searching the Internet for it will show lots of people running into problems in various scenarios where that broke things.
@sdroege, that's a good point (as always)! I've read the article you provided and tried to refresh my knowledge of the Nagle algorithm and indeed it seems like having the TCP_NODELAY
off is not that bad. I remember that in tungstenite
we had the TCP_NODELAY
enabled primarily of the concerns that the smaller packets won't be sent immediately and would cause not only delays, but problems on the receiver side that may not get a message at all if it's very small, but after re-checking the Nagle's algorithm I've figured that it's not the case as it seems like it would buffer the smaller messages only if there are unacknowledged segments while sending them otherwise.
LGTM
hi, thanks for making this change! would love to get the next release with this change pushed to crates.io so we can start using it in some projects soon :)
Fixes #250.