// Connect to everything in turn until we have a socket.
while (ai && !should_stop) {
int sock = socket(ai->ai_family, SOCK_STREAM, IPPROTO_TCP);
// Connect to everything in turn until we have a socket.
while (ai && !should_stop) {
int sock = socket(ai->ai_family, SOCK_STREAM, IPPROTO_TCP);