even if/when you close the connection, there are still data
in the pipeline running on a separate thread. since the connection is async, those data
keep accumulating, waiting to be processed by your app, until
the close connection command is handled. if you do not close
the connection, it could keep running. erel states in the
initial mpeg library posting that the developer has to handle
closing the connection. my guess would be that you did not do
this in your original project.
in the okhttputils2 version, a connection close option was
provided, and you did you use it. i ran your example on a
pixel3a. i only received 2 log messages relating to data still
in the queue. if you're receiving more message about a waiting
queue, i would attribute that to the device's inability to handle
receiving the data at a faster rate.
you could argue that when the connection is closed, any
lingering data should be dumped. it probably could be
implemented one way or the other at the developer's discretion.
it is unlikely to be handled at the application level. once
async transfer is chosen, however, you effectively limit some
other options. it's tough to have things both ways.