[EXTERNAL] Re: Support for Keepalive Extended Socket Options On Windows

Daniel Jeliński djelinski1 at gmail.com
Wed Jun 7 12:48:27 UTC 2023


FWIW, TCP_KEEPIDLE and TCP_KEEPINTVL are available on Windows,
starting with Windows 10, version 1709:
https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-tcp-socket-options

Apparently TCP_KEEPCNT is available too. Can we use these options and
wait for older Windows versions to go out of support?
Regards,
Daniel

śr., 7 cze 2023 o 00:43 Terry Chow (Simba Technologies Inc)
<v-terrychow at microsoft.com> napisał(a):
>
> Hi Daniel,
>
> That sounds good. I like the idea of using a system property to override the defaults just in case. For the starting default values, 2hrs and 1s for idle time and interval time respectively are the officially documented defaults. So, we could start with these.
>
> Just to reiterate, to start off with the prototype:
>
> Persist default values at the socket level in either SocketImpl or NIOSocketImpl
> Allow default values to be overridden through system properties
> Starting default values for idle time and interval time will be 2hrs and 1s
>
> Let me know if that's acceptable or if there's more to add.
>
> Thanks,
> Terry
> ________________________________
> From: Daniel Fuchs <daniel.fuchs at oracle.com>
> Sent: June 6, 2023 4:22 AM
> To: Terry Chow (Simba Technologies Inc) <v-terrychow at microsoft.com>; Alan Bateman <Alan.Bateman at oracle.com>; net-dev at openjdk.org <net-dev at openjdk.org>
> Subject: Re: [EXTERNAL] Re: Support for Keepalive Extended Socket Options On Windows
>
> [You don't often get email from daniel.fuchs at oracle.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Hi Terry,
>
> I'm not sure what would be a good default value, but it could
> possibly be controlled by a system property allowing to override
> whatever we pick.
>
> best regards,
>
> -- daniel
>
>
> On 05/06/2023 20:52, Terry Chow (Simba Technologies Inc) wrote:
> > Hi Alan and Daniel,
> >
> > Agreed, having Windows support the keepalive options as it's done on
> > other platforms would be the best. But, lobbying them for that change
> > would be extremely difficult as it would be very significant change that
> > impacts the whole platform.
> >
> > What defaults values do you guys have in mind? I'm still hesitating on
> > persisting default values because the default values can vary between
> > machines.
> >
> > Thanks,
> > Terry
> > ------------------------------------------------------------------------
> > *From:* Alan Bateman <Alan.Bateman at oracle.com>
> > *Sent:* June 4, 2023 7:32 AM
> > *To:* Daniel Fuchs <daniel.fuchs at oracle.com>; Terry Chow (Simba
> > Technologies Inc) <v-terrychow at microsoft.com>; net-dev at openjdk.org
> > <net-dev at openjdk.org>
> > *Subject:* [EXTERNAL] Re: Support for Keepalive Extended Socket Options
> > On Windows
> > [You don't often get email from alan.bateman at oracle.com. Learn why this
> > is important at https://aka.ms/LearnAboutSenderIdentification
> > <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Faka.ms%2FLearnAboutSenderIdentification__%3B!!ACWV5N9M2RV99hQ!L3ZqYRNNOoxRi17MfA-Xuhn96mbJFGf8N9hRRT_fKwRroiRBdo_QNCcfm6-S-qa3FXTquasM6y3tpVE_ac_Dl3MS7A%24&data=05%7C01%7Cv-terrychow%40microsoft.com%7C09c9036c5d5d420df86808db668052e1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638216473566084303%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CfX27E30RGI%2BOVkENWm1La8JmRs5Qnjc7eNAjplQgZA%3D&reserved=0> ]
> >
> > On 04/06/2023 10:49, Daniel Fuchs wrote:
> >> Hi,
> >>
> >> Could we maybe cache the values in the SocketImpl/NIOSocketImpl
> >> implementation?
> >>
> >> IIRC we do something like that for SO_TIMEOUT already, since this
> >> is handled at NIO level.
> >>
> >> If we know the default value then setting one (when the other is
> >> not set) could set it with the supplied value for the one, and
> >> the default (or cached value) for the other?
> >>
> >> Get would then return the cached value (or possibly default
> >> value if not set?)
> >>
> >> We could also potentially set some sensible defaults when creating
> >> the socket.
> >>
> > Yes, this is what I was suggesting in PR14232 too but it will likely be
> > a disruptive change. It can be prototyped at least, then we can see how
> > we could turn it into something that is maintainable. The best outcome
> > would of course be for Windows to expose the socket options in the same
> > way as Linux, macOS and others.
> >
> > -Alan
>


More information about the net-dev mailing list