Added while loop over recv in handleConnection