adamdruppe / arsd

This is a collection of modules that I've released over the years. Most of them stand alone, or have just one or two dependencies in here, so you don't have to download this whole repo.
http://arsd-official.dpldocs.info/arsd.html
531 stars 128 forks source link

WebSocket ability to set TCP_NODELAY #366

Closed CoderNate closed 1 year ago

CoderNate commented 1 year ago

Minor thing but it would be cool to be able to get rid of the latency from the Nagle algorithm but the socket inside of a WebSocket is private so I can't call setOption. I thought maybe I'd just send an extra Pong message with some dummy bytes in it just to fill the send buffer but it looks like there's a minor bug in pong where it doesn't add bytes to the frame until after it's been sent:

https://github.com/adamdruppe/arsd/blob/853835196e8eb2b05c94cf244ee45941a3fdc8f8/http2.d#L4928-L4929

adamdruppe commented 1 year ago

whoops that's a silly bug. but yeah the nodelay is really just an oversight, since it handles buffering internally i should have disabled it anyway.

adamdruppe commented 1 year ago

see how that commit works for you

CoderNate commented 1 year ago

Your turnaround time on issues is amazing. That fixes it. Thanks!

adamdruppe commented 1 year ago

Some of these things are just trivial oversights I forgot about or didn't test right. Then a bunch of things are on my list and I've thought about them before and laid groundwork for it but never finished (each individual thing can be quick but when I have hundreds of them in between other responsibilities there's a prioritization bump you get by nagging me about it so I can do it quick when otherwise I wouldn't have gotten around to it for maybe a couple years.)

But yeah if things come up just let me know, if I can't turn it around I'll still at least always try to answer same day (or next day if it comes in when I'm already in bed).