Terminates the iteratee when connection is closed
Use fold instead of foreach