public interface WebsocketOutbound extends NettyOutbound
Modifier and Type | Field and Description |
---|---|
static java.util.function.Function<? super ByteBuf,? extends WebSocketFrame> |
bytebufToWebsocketFrame |
static java.util.function.Function<? super String,? extends WebSocketFrame> |
stringToWebsocketFrame |
Modifier and Type | Method and Description |
---|---|
String |
selectedSubprotocol()
Returns the websocket subprotocol negotiated by the client and server during
the websocket handshake, or empty if none was requested.
|
NettyOutbound |
send(Publisher<? extends ByteBuf> dataStream)
Sends data to the peer, listens for any error on write and closes on terminal signal
(complete|error).
|
Mono<Void> |
sendClose()
Prepare to send a close frame on subscribe then close the underlying channel
|
Mono<Void> |
sendClose(int rsv)
Prepare to send a close frame on subscribe then close the underlying channel
|
Mono<Void> |
sendClose(int rsv,
int statusCode,
String reasonText)
Prepare to send a close frame on subscribe then close the underlying channel
|
Mono<Void> |
sendClose(int statusCode,
String reasonText)
Prepare to send a close frame on subscribe then close the underlying channel
|
default NettyOutbound |
sendString(Publisher<? extends String> dataStream,
Charset charset)
Sends String to the peer, listens for any error on write and closes on terminal signal
(complete|error).
|
alloc, neverComplete, options, sendByteArray, sendFile, sendFile, sendFileChunked, sendGroups, sendObject, sendObject, sendString, sendUsing, subscribe, then, then, then, withConnection
static final java.util.function.Function<? super String,? extends WebSocketFrame> stringToWebsocketFrame
static final java.util.function.Function<? super ByteBuf,? extends WebSocketFrame> bytebufToWebsocketFrame
String selectedSubprotocol()
NettyOutbound send(Publisher<? extends ByteBuf> dataStream)
NettyOutbound
A new NettyOutbound
type (or the same) for typed send
sequences.
Note: Nesting any send* method is not supported.
send
in interface NettyOutbound
dataStream
- the dataStream publishing OUT items to write on this channelNettyOutbound
to append further send. It will emit a complete
signal successful sequence write (e.g. after "flush") or any error during write.Mono<Void> sendClose()
Mono
fulfilled when the send succeeded or failed, immediately
completed if already closedMono<Void> sendClose(int rsv)
rsv
- reserved bits used for protocol extensionsMono
fulfilled when the send succeeded or failed, immediately
completed if already closedMono<Void> sendClose(int statusCode, @Nullable String reasonText)
Mono<Void> sendClose(int rsv, int statusCode, @Nullable String reasonText)
rsv
- reserved bits used for protocol extensionsstatusCode
- Integer status code as per RFC 6455. For
example, 1000 indicates normal closure.reasonText
- Reason text. Set to null if no text.Mono
fulfilled when the send succeeded or failed, immediately
completed if already closeddefault NettyOutbound sendString(Publisher<? extends String> dataStream, Charset charset)
NettyOutbound
Note: Nesting any send* method is not supported.
sendString
in interface NettyOutbound
dataStream
- the dataStream publishing Buffer items to write on this channelcharset
- the encoding charset