Hey all, I have a question: what is the difference...
# ktor
c
Hey all, I have a question: what is the difference between:
Copy code
install(HttpTimeout) {
    requestTimeoutMillis =
    connectTimeoutMillis =          
}
And
Copy code
engine {
    endpoint {
        connectTimeout = 
        connectRetryAttempts = 
    }
    requestTimeout = 
}
In particular I could see the timeout from
HttpTimeout
working but I could also see the default value of
engine.requestTimeout
being used (before I changed it). Also, which
connectTimeout
will be used ?
HttpTimeout
of the one
engine.endpoint
? Note, I am using the CIO engine with Ktor 1.4.2
r
Hi! Every engine has its own timeout mechanisms and you can specify them directly using
engine { ... }
block. But it can be more convenient to specify them all once by using
HttpTimeout
feature. In practice, it doesn’t handle
connectTimeout
and
socketTimeout
itself, but only sets it to engine. If you set both,
HttpTimeout
config will win
c
Understood: I have now set both to the same value. But, I didn't' set the engine timeout initially, I was still seeing it kicking, as well as the other timeout too!