This forum has been archived. Please start a new discussion on GitHub.

Connection delay when accessing server using hostname


We currently a windows machine that seems to have DNS resolution issues.

On this particular machine, when we launch our client and connect to the server using only its hostname, the connection stalls for 15 seconds. After this time, the connection succeeds.

We have noticed that we can decrease this 15 second delay to 5 seconds by setting "Ice.Override.ConnectTimeout=5000".

We were expecting the connection to actually fail after these 5 seconds, but it succeeds.

Do you have any idea why that is happening? Is this a known windows DNS issue? Why does reducing the connect timeout decrease the connection time?

Do you have any suggestions on how to fix this issue? We would rather not set Ice.Override.ConnectTimeout because that will set the global connect timeout and there are some connections where we want a smaller timeout. Is there a way to set an individual’s connection ConnectTimeout?

We use IceSSL for C++. Just to be clear, this particular machine clearly has some sort of DNS issue. It is able to connect but the long delay is very annoying. We are worried that some customers may also have misconfigured DNS and might also go trough this connection delay. We would like to avoid this issue if possible.



  • xdm
    xdm La Coruña, Spain

    Hi Fabio,

    Sound like the DNS is returning several IP addresses, and the first address is not reachable, on Windows the connect calls can take too long to fail, here the connect timeout applies to each connect attempt, and seems that a second attempt uses a different address and succeeds.

    Enabling network and retry tracing will give you a better understanding of what is happening, try setting:


    You can set a per proxy connect timeout using ice_timeout proxy method.