Sudhanshu Singh
09/28/2023, 6:09 AMval client = HttpClient {
install(WebSockets)
}
client.webSocket( urlString = "<wss://sampleA.com/websocket>") {
// listen to incoming messages
}
Is it possible now to close this websocket and open another one with different url?
client.webSocket( urlString = "<wss://sampleB.com/websocket>") {
}
Aleksei Tirman [JB]
09/28/2023, 9:00 AMwebSocketSession
method to have a control over the session:
val client = HttpClient(CIO) {
install(WebSockets)
}
val session = client.webSocketSession("<wss://ws.postman-echo.com/raw/>")
// Do something with the session
session.send(Frame.Text("hello"))
session.close()
val session2 = client.webSocketSession("<wss://ws.postman-echo.com/raw/>")
Sudhanshu Singh
09/28/2023, 9:02 AM