[Interest] TCP ACK with QDataStream -- OR: disconnect race condition detection

Giuseppe D'Angelo dangelog at gmail.com
Mon Sep 10 13:23:12 CEST 2012


On 10 September 2012 11:19, Thiago Macieira <thiago.macieira at intel.com> wrote:
>
>
> There's simply no way to get the number of bytes ACK'ed from the other side. I
> did search the Linux TCP API yesterday and I couldn't find anything suitable.
> And even if there were such a way, the ACK information is useless, since the
> application on the other side may never read from the socket.

Some information is actually available into the tcp_info structure
(defined in /usr/include/linux/tcp.h) and filled in with a call to
getsockopt(IPPROTO_TCP, TCP_INFO), for instance the tcpi_unacked
member sounds like a good candidate -- I didn't check the kernel side
implementation, which I think it's the only true reference available
for this stuff.
-- 
Giuseppe D'Angelo



More information about the Interest mailing list