ursus
04/29/2025, 2:51 PM// ktor client
webSocketSession.send(frame)
this suspends until it's actually sent? or only until enqueued (and will be sent later)?
if it's the later - is there a way to tell it's actually been delivered?
--
I need to update my entity's state from SENDING
to SENT
Youssef Shoaib [MOD]
04/29/2025, 3:10 PMEnqueue a frame, may suspend if an outgoing queue is full. May throw an exception if the outgoing channel is already closed, so it is impossible to transfer any message. Frames that were sent after close frame could be silently ignored. Note that a close frame could be sent automatically in reply to a peer's close frame unless it is raw WebSocket session.While
flush
says:
Flushes all outstanding messages and suspends until all earlier sent messages will be written. Could be called at any time even after close. May return immediately if the connection is already terminated. However, it may also fail with an exception (or cancellation) at any point due to a session failure. Note that flush doesn't guarantee that frames were actually delivered.So it seems there is no easy way to figure out if the frames were delivered or not, but
flush
guarantees they were sent at leastursus
04/29/2025, 3:11 PMflush
is a no-op ehmursus
04/29/2025, 3:19 PMDaniel Pitts
04/30/2025, 4:42 PMursus
04/30/2025, 7:07 PMDaniel Pitts
04/30/2025, 7:17 PMursus
04/30/2025, 7:26 PMDaniel Pitts
04/30/2025, 7:40 PMursus
04/30/2025, 7:43 PMursus
04/30/2025, 7:46 PMDaniel Pitts
04/30/2025, 7:47 PMursus
04/30/2025, 7:54 PMDaniel Pitts
04/30/2025, 9:15 PMursus
04/30/2025, 9:20 PMDaniel Pitts
04/30/2025, 9:20 PMursus
04/30/2025, 9:21 PMDaniel Pitts
04/30/2025, 9:23 PMDaniel Pitts
04/30/2025, 9:23 PMursus
04/30/2025, 9:26 PMursus
04/30/2025, 9:26 PMDaniel Pitts
04/30/2025, 9:27 PMursus
04/30/2025, 9:28 PMSo just leave it pendingfor ever? as in dont have a error state?
Daniel Pitts
04/30/2025, 9:29 PMursus
04/30/2025, 9:29 PMDaniel Pitts
04/30/2025, 9:30 PMursus
04/30/2025, 9:30 PMDaniel Pitts
05/01/2025, 3:17 PMDaniel Pitts
05/01/2025, 3:17 PMursus
05/01/2025, 3:49 PM