WiFiClient::connected() not working
This is a bug in a previous version of the library as mentioned on 
https://github.com/bportaluri/WiFiEsp/issues/14

You can alternatively use WiFi.softAPgetStationNum() to get the count of stations connected to the AP interface.