I’ve the problem with ktor-curl on macOS. ``` ...
# ktor
a
I’ve the problem with ktor-curl on macOS.
Copy code
val response = <http://httpClient.post|httpClient.post><T>(url) {
                    contentType(ContentType.Application.Json)
                    body = "some json"
                }
This code executed on windows ~1 sec but on macOS - first request < 1 sec but next ~ 15 sec. kotlin 1.4.10, ktor 1.4.2,
io.ktor:ktor-client-curl
and others. How can I look up a problem?
e
Hey @aleksey.tomin, could you file an issue in YT? I will take a look
a
I will try to extract an example for this
e
Thanks, It would be great
j
Is it a request to your local machine?
I had problems with names resolved to localhost (not related to Ktor)
a
No. It request to the remote host
@e5l problem with macOS native window and NSApplication.sharedApplication().run() Now I’m creating the example
🙏 1
@e5l I’ve replaced
Copy code
val app = NSApplication.sharedApplication
...
app.run()
by
Copy code
val app = NSApplication.sharedApplication
...
app.finishLaunching()
while (active.value) {
    app.nextEventMatchingMask(NSEventMaskAny, null, NSDefaultRunLoopMode, true)?.let {
        app.sendEvent(it)
    }
    runBlocking { 
        delay(100.milliseconds)
    }
}
and fix the problem. It’s not a ktor bug. But it can be useful.