simon.vergauwen
10/14/2022, 10:36 AMmacArm64
(have not tried linux yet), but when I call engine.stop(5000, 10_000)
on the ApplicationEngine
it keeps the port occupied, and I get following exception when I try to re-run the server. I'm running the hello world example from the samples repo. Any ideas on how to fix this? Or is this a bug? I couldn't find any bug report on YouTrack, but happy to add one if needed βΊοΈ
Uncaught Kotlin exception: io.ktor.utils.io.errors.PosixException.AddressAlreadyInUseException: EADDRINUSE (48): Address already in use
simon.vergauwen
10/14/2022, 11:15 AMstop
π€
It noticed that after some time the port became available again, and decreasing the duration of the parameters passed to stop
seem to increase the speed at which the port becomes available again..simon.vergauwen
10/14/2022, 11:17 AMCIOApplicationEngine.shutdownServer
.ribesg
10/14/2022, 12:44 PMhfhbd
10/14/2022, 7:12 PMsimon.vergauwen
10/15/2022, 8:55 AMApplicationEngine#stop
.
Btw really awesome work on the NativePostgres engine & Postgres work for SqlDelight π I am playing around with it, and it's a really promising project.hfhbd
10/15/2022, 9:04 AMsimon.vergauwen
10/15/2022, 9:07 AMnapperley
10/15/2022, 10:08 PMhfhbd
10/15/2022, 10:11 PMnapperley
10/15/2022, 10:12 PMnapperley
10/15/2022, 10:19 PMsimon.vergauwen
10/16/2022, 9:36 AMKotlinX AtomicFuThis dependency could be removed from Ktor π€
AtomicReference
from Kotlin Std is supported for all native targets, or is the performance benefit of AtomicFieldUpdater
on the JDK so big and so widely used in Ktor?simon.vergauwen
10/16/2022, 9:38 AMSam
01/31/2023, 9:47 PMSkaldebane
11/23/2024, 9:59 PMreuseAddress = true
in the CIO engine configuration like so:
embeddedServer(factory = CIO, configure = {
connector { port = 8080 }
reuseAddress = true
}) {
// ...
}
I assume this sets the SO_REUSEADDR
flag on the socket as the Stack Exchange answer linked by @hfhbd states.Sam
11/23/2024, 10:01 PMSkaldebane
11/23/2024, 10:18 PM