Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does TCP_NODELAY get inherited through accept?

Tags:

tcp

sockets

nagle

If I were to create a TCP socket with the TCP_NODELAY option enabled and use it to listen for new connections, would new sockets returned by accept also have TCP_NODELAY enabled?

Different sockets can have differently configured options, though it would make sense that sockets returned by accept inherit their options from the listening socket that spawned them. Is this implementation-dependent?

like image 550
Wingblade Avatar asked Oct 29 '22 21:10

Wingblade


1 Answers

Yes, TCP_NODELAY on a listening socket is inherited by accepted sockets. Tested on Linux 4.18.0.

like image 128
Ted Percival Avatar answered Nov 02 '22 22:11

Ted Percival