Skip to content

Commit

Permalink
Manually construct frames
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheikah45 committed Oct 13, 2023
1 parent 580eda1 commit 5106364
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@ class FafLobbyClient(
return webSocketClient
.uri(config.url)
.handle { inbound, outbound ->
val inboundMono = inbound.receiveFrames()
.windowUntil { it.isFinalFragment }
.flatMap { ByteBufFlux.fromInbound(it.map { frame -> frame.content() }).asString(Charsets.UTF_8).collect(Collectors.joining()) }
val inboundMono = inbound.receive()
.asString()
.flatMapIterable { it.toCharArray().asIterable() }
.windowUntil { '\n' == it }
.flatMap { it.collectList().map { chars -> chars.toCharArray() }.map { charArray -> String(charArray) } }
.doOnError { LOG.error("Inbound channel closed with error", it) }
.doOnComplete { LOG.info("Inbound channel closed") }
.doOnCancel { LOG.info("Inbound channel cancelled") }
Expand Down

0 comments on commit 5106364

Please sign in to comment.