The 10 second timeout example above shows how to close a connection from the client end. Note there is no break after the timeout client.stop(). Allow the "while(client.connected()) { while(client.available())" loops to exit normally. That insures the connection is closed.