c - Are socket options inherited across accept() from the listening socket? -


suppose listening socket passed accept has non-default options set on setsockopt. these options (some or of them?) inherited resulting file descriptors accepted connections?

several of socket options handled @ lower levels of system. while of socket options set using setsockopt. reference:man setsockopt , since mentioning posix on linux, in general, scope. accept() (reference: man accept) have amount of discretion on socket options should inherited , options reject listening fd.

accept() not modify original socket passed argument. new socket returned accept() not inherit file status flags such o_nonblock,o_async listening socket.

so, instead of relying on inheritance or non-inheritance of listening socket properties(which bound vary across implementations , licenses), accepted socket should explicitly set desired socket options.(best practice)

man pages , implementation codes in machine relevant specification accept() behavior.there's no common or standard specification existing across multiple variants of linux.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -