Skip to content

Commit ad9f817

Browse files
authored
gh-91498: socket: Add TCP_CONNECTION_INFO on macOS (#69256)
Fixes GH-91498
1 parent b733708 commit ad9f817

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Doc/library/socket.rst

+4
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,10 @@ Constants
388388
Added ``TCP_KEEPALIVE``. On MacOS this constant can be used in the same
389389
way that ``TCP_KEEPIDLE`` is used on Linux.
390390

391+
.. versionchanged:: 3.11
392+
Added ``TCP_CONNECTION_INFO``. On MacOS this constant can be used in the
393+
same way that ``TCP_INFO`` is used on Linux and BSD.
394+
391395
.. data:: AF_CAN
392396
PF_CAN
393397
SOL_CAN_*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add the ``TCP_CONNECTION_INFO`` option (available on macOS) to :mod:`socket`.

Modules/socketmodule.c

+3
Original file line numberDiff line numberDiff line change
@@ -8213,6 +8213,9 @@ PyInit__socket(void)
82138213
#ifdef TCP_INFO
82148214
PyModule_AddIntMacro(m, TCP_INFO);
82158215
#endif
8216+
#ifdef TCP_CONNECTION_INFO
8217+
PyModule_AddIntMacro(m, TCP_CONNECTION_INFO);
8218+
#endif
82168219
#ifdef TCP_QUICKACK
82178220
PyModule_AddIntMacro(m, TCP_QUICKACK);
82188221
#endif

0 commit comments

Comments
 (0)