debugs... 4

This commit is contained in:
dalbodeule 2024-11-25 20:04:50 +09:00
parent c14fc53dee
commit 4fca9df9c2
No known key found for this signature in database
GPG Key ID: EFA860D069C9FA65
3 changed files with 5 additions and 2 deletions

View File

@ -57,6 +57,9 @@ fun Routing.wsSongListRoutes() {
for (frame in ws.incoming) { for (frame in ws.incoming) {
if (frame is Text) { if (frame is Text) {
val message = frame.readText() val message = frame.readText()
if(message == "ping") {
return true
}
val data = Json.decodeFromString<SongRequest>(message) val data = Json.decodeFromString<SongRequest>(message)
if (data.type == SongType.ACK.value) { if (data.type == SongType.ACK.value) {
return true // ACK received return true // ACK received

View File

@ -98,7 +98,7 @@ fun Routing.wsSongRoutes() {
for (frame in incoming) { for (frame in incoming) {
when(frame) { when(frame) {
is Frame.Text -> { is Frame.Text -> {
if(frame.readText() == "ping") { if(frame.readText().trim() == "ping") {
send("pong") send("pong")
} }
} }

View File

@ -75,7 +75,7 @@ fun Routing.wsTimerRoutes() {
for (frame in incoming) { for (frame in incoming) {
when(frame) { when(frame) {
is Frame.Text -> { is Frame.Text -> {
if(frame.readText() == "ping") { if(frame.readText().trim() == "ping") {
send("pong") send("pong")
} }
} }