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

André Somers andre at familiesomers.nl
Tue Sep 11 10:19:04 CEST 2012

Op 11-9-2012 9:44, Till Oliver Knoll schreef:
> 2012/9/11 d3fault <d3faultdotxbe at gmail.com>:
>> lol thanks for explaining to me what TCP is. Already knew that before
>> making this thread...
> There still seem to be some mis-conceptions about what TCP *really* is
> (and "network layers" in general) on your side though ;)
> Let's go through it step by step (I'm no network expert either, so I
> probably make over-simplistic statements, but you'll get the point
> anyway, I hope):
> By the way, did you already read my previous post?
>> But how can you say:
>> a) TCP ACKs can't be used for application layer reliability
> Because a "TCP ACK" simply means: "I have received the first N bytes
> in *order*". Point. There is no more information in that, other than
> the sender knows: "Yes, the *Transport* layer (repeat after me:
> *Transport* layer, *Transport* layer...) has properly received the
> first N bytes in order.
Just one side note (on an otherwise good explanation):
N need *not* be the same as the number of bytes you want to send in a 
message inside your stream! The message may be choped up in any number 
of parts, depending on the underlying network. A single 1K message _may_ 
result in a dozen or more ACK messages on the TCP level (or just one, of 
course). You as an application programmer do not know, and you really, 
really do not *want* to know. The TCP ACKs are an implementation detail 
of the TCP protocol. It has nothing to do with your application, but it 
is simply a part of the machinery that is responsible for making sure 
TCP can do what it promises to do: deliver a reliable connection (in the 
sense already explained earlier).
> If you're really curious about all this, then get a good book:
> "Computer Networks" by Andrew S. Tanenbaum (a classic and must-read!)
> was already mentioned.
Been there, done that, got the university degree to prove it ;-) But I 
agree: it is a good book.
Short introductions to the ideas in protocol layers can be found by 
googling on "OSI model" and "Internet Protocol Suite".


More information about the Interest mailing list