mIRC Homepage
Posted By: Wims /socklisten -n, disable nagle algorithm - 17/07/22 09:42 PM
/sockopen -n was added to disable the nagle algorithm but if the socket comes from a listening socket, we cannot have the same effect, could it be added please?
Posted By: Wims Re: /socklisten -n, disable nagle algorithm - 15/09/22 05:56 AM
Sorry to be late about this, I saw socklisten -n was added, I had tested it but without really seeing any difference. I just noticed while trying to document it on wikichip that I made a mistake, sort of.

The sockets where it would be useful to disable the nagle algorithm are the socket created by /sockaccept, not the socket created by /socklisten, where no data are sent/received.

I'm not expert on the nagle algorithm bit at all, I have no idea if it's worth keeping a support for it in /socklisten, but at least /sockaccept would need to support it.
Posted By: Khaled Re: /socklisten -n, disable nagle algorithm - 21/09/22 08:25 AM
Technically, accept() sockets should inherit some properties from the listen() socket although that may depend on the operating system. Another potential issue is that some setsockopt() options usually need to be set prior to other socket-related calls, otherwise they won't be set. I have made a change to the next beta so that the accept socket itself is changed the moment it is accepted and that seems to be working.
Posted By: Wims Re: /socklisten -n, disable nagle algorithm - 21/09/22 09:37 AM
Thanks for looking into it.

I take it the -n switch of /socklisten will still be how you enable the feature, making it so that if enabled, it's enabled for all accepted socket, with no way to select which accepted socket has the feature enabled? That should be fine in most cases, and for me anyway, but... why limit it, wouldn't it better to allow it per accepted socket? Or was it intended from you to limit/make it that way? This implicit suggestion would require a $sock().nagle property to work, but that property would still be great to have if the design stay the same
Posted By: Khaled Re: /socklisten -n, disable nagle algorithm - 21/09/22 11:43 AM
I have changed this to work for both "/socklisten -n" and "/sockaccept -n". If /socklisten -n is used, accepted sockets will inherit the -n automatically. If /socklisten -n is not used, accepted sockets can use /sockaccept -n individually.
Posted By: Wims Re: /socklisten -n, disable nagle algorithm - 21/09/22 05:42 PM
Perfect, thanks.
© mIRC Discussion Forums