lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b6d8611a-714c-4fb0-5027-584884bb66a1@petrovitsch.priv.at>
Date:   Tue, 21 Jun 2022 09:02:38 +0200
From:   Bernd Petrovitsch <bernd@...rovitsch.priv.at>
To:     "Ryan P. Nicholl" <rnicholl@...tonmail.com>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: Networking Question

Hi all!

On 21/06/2022 02:29, Ryan P. Nicholl wrote:
> I've been unable to find any Linux API for asynchronously waiting for the TCP send buffer to drain.
> 
> The problem I have, in a nutshell, is noted in this part of the documentation:
> 
>         If fildes refers to a socket, close() shall cause the socket to
>         be destroyed. If the socket is in connection-mode, and the

That's not really a Linux kernel question as such (because that should 
work that way on all TCP connections anywhere) but the shutdown() 
syscall is probably what you need:
- your side shuts down the sending part of the socket.
- the other side reads data and gets eventually EOF
- the other side call shutdown() for it's sending side when it's done.
- your side gets EOF.
And then your side knows that no data is in flight.
- finally, you clean up with close(). You can shutdown() the receiving
   side too but doesn't change anything.

[ deleted SO_LINGER stuff - that's for something completelly different ... ]

Kind regards,
	Bernd
-- 
Bernd Petrovitsch                  Email : bernd@...rovitsch.priv.at
      There is NO CLOUD, just other people's computers. - FSFE
                      LUGA : http://www.luga.at

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ