Hi. Is it possible to force Ktor with OkHttp to re...
# ktor
e
Hi. Is it possible to force Ktor with OkHttp to reconnect on every request? Now it seems it re-uses the same socket. At least in Wireshark when I "Follow TCP stream" I can see all the previous requests. The server I'm talking to is a bit fragile and doesn't like this
j
Is the client closable? Perhaps you can recreate the client and close the client after every request (this might be more resource intensive on client side)
e
I have tried re-creating the instance of my client, but it doesn't seem to have an effect. OkHttp is "object", some things might live forever (such as connection pool)?
Oh, forgot to call
.close()
, that seems to do the trick
Re-create +
.use
. Thanks @Joost Klitsie, close was the problem 🙂
👍 1
j
good to hear you found it! 🙂