https://kotlinlang.org logo
#ktor
Title
# ktor
e

Emil Kantis

09/14/2022, 10:05 AM
Using ktor-network, how can I accept incoming connections while still respecting cancellation? acceptSuspend does a
while (true)
loop until a connection appears.
My use-case was to run the TCP server from tests. I worked around it by starting the server in it's own thread pool instead, then terminating the pool.
2 Views