Attempt to connect 5 times before giving up