I am using the TCPClient.connected() on 0.4.9 on a Photon almost without problems. I have a TCP server and it reliably discovers a client closing the connection. In that case TCPClient.connected() returns false. So that should work fine, now. @Garrett, can you double check that?
However there seems to be one loop hole left: When I have up to 4 parallel connections everything is great. When the client opens a 5th parallel connection then the following happens: The breathing cyan LED flashes a couple of times very quickly. Then the client sees a closed connection. I guess that’s fine, some mechanism to avoid overload with more than 4 connections. I am very glad that’s in place, so it is not too easy to do a denial of service to the Photon. BUT: In that case the TCPClient.connected() call on that connections still returns true. In my case that’s fine, because I can detect the situation when the next write fails. But if there is no write, then the connection seems to stay open forever. @mdma, can you check that, please?
If necessary I could provide some example code, but I think it is really easy to reproduce that.
Thanks in advance!