src/tcp_multi.c
/**
 * This procedure tries every protocol in order, trying every address once
 * with the procol before moving on.
 */
This procedure tries every protocol in order, trying every address once
with the procol before moving on.
This procedure tries every protocol in order trying every address once with the procol before moving on .
static int
enftun_tcp_multi_connect_any(struct enftun_tcp* tcp,
                             const char** hosts,
                             const char* port,
                             int fwmark)
{
    int i;
    int rc = 0;
    for (i = 0; i < enftun_tcp_ops_size; i++)
    {
        enftun_multi_init_types[i](tcp);
        rc = tcp->ops.connect_any(tcp, hosts, port, fwmark);
        if (!rc)
            break;
        tcp->ops.close(tcp);
    }
    if (rc)
        enftun_tcp_multi_init(tcp);
    return rc;
}
static int enftun_tcp_multi_connect_any ( struct enftun_tcp * tcp , const char * * hosts , const char * port , int fwmark ) { int i ; int rc = 0 ; for ( i = 0 ; i < enftun_tcp_ops_size ; i ++ ) { enftun_multi_init_types [ i ] ( tcp ) ; rc = tcp -> ops . connect_any ( tcp , hosts , port , fwmark ) ; if ( ! rc ) break ; tcp -> ops . close ( tcp ) ; } if ( rc ) enftun_tcp_multi_init ( tcp ) ; return rc ; }
This procedure tries every protocol in order, trying every address once
 with the procol before moving on.
This procedure tries every protocol in order trying every address once with the procol before moving on .
// If all ops failed revert back to multi type