retry after 5 seconds if unable to create a TCP connection

print error message and retry after 5 seconds instead of panicking/crashing