socket: add TCP_KEEPALIVE (#8100)

bpo-34932

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu
2022-06-19 09:57:07 -07:00
committed by GitHub
parent 411d85feeb
commit 34579f1edf
2 changed files with 4 additions and 0 deletions

View File

@@ -273,6 +273,8 @@ TCP_SYNCNT: int
TCP_WINDOW_CLAMP: int
if sys.version_info >= (3, 7):
TCP_NOTSENT_LOWAT: int
if sys.version_info >= (3, 10) and sys.platform == "darwin":
TCP_KEEPALIVE: int
if sys.version_info >= (3, 11) and sys.platform == "darwin":
TCP_CONNECTION_INFO: int

View File

@@ -214,6 +214,8 @@ if sys.platform != "win32":
from _socket import CMSG_LEN as CMSG_LEN, CMSG_SPACE as CMSG_SPACE, sethostname as sethostname
if sys.platform != "win32" or sys.version_info >= (3, 8):
from _socket import if_indextoname as if_indextoname, if_nameindex as if_nameindex, if_nametoindex as if_nametoindex
if sys.platform == "darwin" and sys.version_info >= (3, 10):
from _socket import TCP_KEEPALIVE as TCP_KEEPALIVE
if sys.platform == "linux":
from _socket import (
ALG_OP_DECRYPT as ALG_OP_DECRYPT,