Ethernet data transfer stalling or failing

doughboy:
isn't it that with streams, only reading a value of -1 tells you it is at the end of stream?

your code is only relying on client.available()

source can always send partially filled buffers, in which case, available will return false, but that does not mean it is the end of stream.

That's interesting - so if I understand correctly, you're saying that I should really be checking whether or not read() returns -1? What confuses me is why available() seems to never return true after the data has started to stall, but presumably at some point we'd expect it to become true when more data was available in the buffer from the source?