Skip to content

Commit 82497a6

Browse files
patchback[bot]Cycloctanebdraco
authored
[PR #10961/5e68276c backport][3.12] fix example in socket_factory docs (#10967)
Co-authored-by: Cycloctane <[email protected]> Co-authored-by: J. Nick Koston <[email protected]>
1 parent 11c7c43 commit 82497a6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGES/10961.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
10520.feature.rst

docs/client_advanced.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,12 +706,13 @@ make all sockets respect 9*7200 = 18 hours::
706706
import socket
707707

708708
def socket_factory(addr_info):
709-
family, type_, proto, _, _, _ = addr_info
709+
family, type_, proto, _, _ = addr_info
710710
sock = socket.socket(family=family, type=type_, proto=proto)
711711
sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, True)
712712
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 7200)
713713
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 9)
714714
return sock
715+
715716
conn = aiohttp.TCPConnector(socket_factory=socket_factory)
716717

717718
``socket_factory`` may also be used for binding to the specific network

0 commit comments

Comments
 (0)