bpo-34932: Add socket.TCP_KEEPALIVE for macOS (GH-25079)

This commit is contained in:
Shane Harvey 2021-07-14 15:53:15 -07:00 committed by GitHub
parent 2b47af6398
commit d59d7374a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 0 deletions

View file

@ -8158,6 +8158,10 @@ PyInit__socket(void)
#endif
#ifdef TCP_KEEPIDLE
PyModule_AddIntMacro(m, TCP_KEEPIDLE);
#endif
/* TCP_KEEPALIVE is OSX's TCP_KEEPIDLE equivalent */
#if defined(__APPLE__) && defined(TCP_KEEPALIVE)
PyModule_AddIntMacro(m, TCP_KEEPALIVE);
#endif
#ifdef TCP_KEEPINTVL
PyModule_AddIntMacro(m, TCP_KEEPINTVL);