From: yuan linyu <cug...@163.com> Date: Sun, 8 Jan 2017 18:47:30 +0800
> From: yuan linyu <linyu.y...@alcatel-sbell.com.cn> > > user input flags store to newsock which should be used. > > Signed-off-by: yuan linyu <linyu.y...@alcatel-sbell.com.cn> It is the file flags of the parent listening socket that determines if the accept() blocks or not. The man page for accept() is clear about this: ... and the socket is not marked as nonblocking meaning the parent listening socket. The "flags" argument of accept4() is purely for setting flags on the accepted new child socket, it has no influence whatsoever about the blocking of the accept() call or not. That behavior is determined in the context of the listening socket.