Finished work on making connection attempt stop when connection has failed.