Tianyu Zhu
08/01/2023, 3:25 PMSergey Aldoukhov
08/01/2023, 6:34 PMTianyu Zhu
08/05/2023, 10:53 PMSergey Aldoukhov
08/05/2023, 11:49 PMget("/") {
call.respondOutputStream {
// You can write response to this output stream
// Note: It should be done in a separate thread
it.bufferedWriter().use { writer ->
writer.write("Hello world!")
}
}
}
Another approach is to use Websockets, which is better in a sense you can do both sending and receiving using the same socket connection, but it will be not as performant as using respondOutputStream