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

d3fault d3faultdotxbe at gmail.com
Sun Sep 9 20:54:09 CEST 2012

Haha, funny. Reliable doesn't mean reliable. Who knew...

Are you sure it isn't just Qt failing to utilize the TCP protocol
correctly? I don't mean to question your expertise, as you sound like
you know what you're talking about, but this quote from wikipedia
makes it sound like TCP does in fact do mid-stream reliability: "TCP
primarily uses a cumulative acknowledgment scheme, where the receiver
sends an acknowledgment signifying that the receiver has received all
data preceding the acknowledged sequence number" [0]. That plus
automatic re-transmission of lost packets sounds like exactly what I
want! How do I get that number in a platform independent manner [and
make sense of it]?

I was going to code my own ack layer on top of TCP... but after a few
designs and reading further into TCP it sounded an awful lot like
reinventing the wheel. I came up with my own sequence number scheme
and everything and oh boy TCP really sucks if you're right :-P...

An actually-reliable-tcp-socket class (called something else, and
perhaps based on QAbstractSocket instead?) sounds like it would make a
great addition to Qt don't you think? Maybe something along the lines
of QNetworkRequest::Acknowledged() [signal].... though not necessarily
anything to do with QNAM (especially since the QNetworkReply makes a
better acknowledgement in that case lol (and now I'm just confusing

[0] - http://en.wikipedia.org/wiki/Transmission_Control_Protocol#Reliable_transmission


More information about the Interest mailing list