Added kill thread to detect connection hangs.