Commit Graph

3 Commits

Author SHA1 Message Date
Gregory Nutt 124212624d net: Minor fix in error checking in TCP/UDP Tx drain logic 2019-07-28 07:39:55 -06:00
Gregory Nutt 361d85ae35 net/tcp and udp: Fix errors in the new implementation of SO_LINGER. The tcp_drain() and udp_drain() functions were casting the working argument to the wrong type, resulting in hangs and abnormal behavior. There is a complexity in the tcp drain logic when the remote peer closes the socket before all Tx data has been flushed. Sometimes we are not notified of this case and wait the entire timeout unnecessarily. There is a workaround in place in tcp_txdrain(), but this really should be revisited. 2019-07-27 10:26:52 -06:00
Gregory Nutt de5a6163d5 This commit implements a proper version of SO_LINGER. Not sufficiently tested on initial commit.
Squashed commit of the following:

    net/: Fix some naming inconsistencies, Fix final compilation issies.

    net/inet/inet_close():  Now that we have logic to drain the buffered TX data, we can implement a proper lingering close.

    net/inet,tcp,udp:  Add functions to wait for write buffers to drain.

    net/udp:  Add support for notification when the UDP write buffer becomes empty.

    net/tcp:  Add support for notification when the TCP write buffer becomes empty.
2019-07-01 12:25:32 -06:00