Skip to content

Commit a099217

Browse files
alex-anthropicnjsmith
authored andcommitted
Set TCP_NODELAY on sockets
1 parent 31639ec commit a099217

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/hypercorn/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ def _create_sockets(
246246
except (ValueError, IndexError):
247247
host, port = bind, 8000
248248
sock = socket.socket(socket.AF_INET6 if ":" in host else socket.AF_INET, type_)
249+
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
249250
if self.workers > 1:
250251
try:
251252
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)

0 commit comments

Comments
 (0)