sendSerializedBase

inline suspend fun <T : Any> WebSocketSession.sendSerializedBase(data: T, converter: WebsocketContentConverter, charset: Charset)

Serializes data to a frame and enqueues this frame. May suspend if the outgoing queue is full. If the outgoing channel is already closed, throws an exception, so it is impossible to transfer any message. Frames sent after a Close frame are silently ignored. Note that a Close frame could be sent automatically in reply to a peer's Close frame unless it is a raw WebSocket session.

Parameters

data

The data to serialize

converter

The WebSocket converter

charset

Response charset