Because it may be quicker to ask: with a TPP, readData()
gets a data size of 0 if the process has finished writing to the network. However, there seems to be no way to find out if it has finished reading from the network, other than to do a .write()
and see if you get an error. (I filed a FB about this, for whatever that's worth.)
Since the API is flow-based, not socket, it's not possible to tell if the app has set its own timeout. Or exited. So one question I have is: if I do flow.write(Data(count:0))
-- is that a possible way to determine if it's still around? Or will it be interpreted as read(2)
returning 0?
(Putting this in for testing is difficult, but not impossible -- as I said, this might be the quickest way to find out.)