Sourabh Rawat
12/08/2020, 12:39 PMfun main() = runBlocking {
val httpClient = HttpClient {
install(Logging) {
level = LogLevel.ALL
}
@OptIn(KtorExperimentalAPI::class)
install(WebSockets)
expectSuccess = false
install(JsonFeature) {
@OptIn(KtorExperimentalAPI::class)
acceptContentTypes = listOf(ContentType("application", "json-rpc"))
serializer = KotlinxSerializer()
}
}
val wss =httpClient.webSocketSession(method = HttpMethod.Get, host = "127.0.0.1", port = 6800, path = "/jsonrpc")
wss.close()
}
this does not stop the program. what am I doing wrong?wss.close()
?