I'm using macOS Sequoia 15.7.3 and Python 3.14.2. When I create an instance of the TCPKeepAliveAdapter, it is not adding a socket option for socket.KEEPALIVE. As a result, the OS default value is used, which is 2 hours on my system and I don't see a keepalive packet until 2 hours after the initial connection is made.
pyproject.toml
[project]
name = "pace-connection-tests"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.14"
dependencies = [
"requests-toolbelt>=1.0.0",
]
test.py
from requests_toolbelt.adapters.socket_options import TCPKeepAliveAdapter
adapter = TCPKeepAliveAdapter()
print(adapter.socket_options)
output
[(6, 1, 1), (65535, 8, 1), (6, 257, 20), (6, 258, 5)]
I'm using macOS Sequoia 15.7.3 and Python 3.14.2. When I create an instance of the
TCPKeepAliveAdapter, it is not adding a socket option forsocket.KEEPALIVE. As a result, the OS default value is used, which is 2 hours on my system and I don't see a keepalive packet until 2 hours after the initial connection is made.pyproject.toml
test.py
output