vpn: OpenVPN uses another port if the default value is blocked

I have two OpenVPN servers listening in two different ports. The first, to which the client should try to connect, is listening on the default port 1194 UDP. The second, used if the networks have a firewall, is listening on port 443 via TCP.

How to configure the client file correctly if:

  1. The client must first test the 1194 UDP-server faster and
  2. if port 1194 is blocked, switch to server 2 with port 443 over TCP after 5 seconds.

Currently, I have added the following two lines to the configuration of my client, but the client only changes to server 2 after 2 minutes with error

TCP: connect to [AF_INET]SERVER: 1194 failed: unknown error

My current lines in the configuration:

remote server1 1194
remote serverip2 443
keepalive 2 6
resolve-retry 2

How to shorten the waiting time?