How can i make sure that all data queued for write on a socket with
O_NONBLOCK set is transmitted (or timeout reached) with a multiplexd
application using select()?
My problem is that if i call close with O_NONBLOCK set, the pending tx
data is discarded. If i call close with O_NONBLOCK cleared and
SO_LINGER set, my process blocks making it unresponsive to other
Ideally i would want the kernel to keep trying to send data after
close until a timeout and silently deallocate the socket after send
completion or timeout.
Close manpage says: "If the O_NONBLOCK or O_NDELAY