12 BIO* bio = BIO_new_connect(addr);
14 BIO_set_conn_port(bio, port);
17 int start_time = time(NULL);
18 while(BIO_do_connect(bio) == 0 && (
int)time(NULL) - start_time < 10);
20 if (BIO_do_connect(bio) <= 0) {
21 fprintf(stderr,
"Failed to open socket: BIO_do_connect returned <= 0\n");