Ktor Server question; I'm building a Ktor server a...
# ktor
i
Ktor Server question; I'm building a Ktor server application, and I also need to run the client application at the same time (so that I can test the client against the server). In my IDE, I'm running the client application, and I'm launching the Ktor server application in the IDE's terminal using
./gradlew :app:server:run --no-daemon
. However, when I make some changes to the server application, I'm killing the terminal process with
control-c
, and then re-running the
./gradlew :app:server:run --no-daemon
task, but it appears that there's still a java process for the server that's kept hanging. This ends up meaning I need to manually kill the server processes (as after a few re-runs of the server, I end up with 10+ java processes hanging around doing nothing). Is there something I am doing wrong with this setup? What's the correct way to run the server for development and then have it fully closed when I stop the gradle task?
a
Can you please check that the server process launched with Gradle and the hanging Java process is the same?
i
They are different processes, but I think that the issue was I wasn't running with the ktor development mode enabled; after enabling that it appears the problem has gone away 🙂
a
That's strange. The development should not affect that.