Top Fields Constructors Methods
reactor.netty5.http.client

pack-priv final Class WebsocketClientOperations

extends HttpClientOperations
implements WebsocketInbound, WebsocketOutbound
Class Inheritance
All Implemented Interfaces
reactor.netty5.http.websocket.WebsocketOutbound, reactor.netty5.NettyOutbound, org.reactivestreams.Publisher, reactor.netty5.http.websocket.WebsocketInbound, reactor.netty5.NettyInbound
Imports
java.net.URI, java.util.concurrent.atomic.AtomicIntegerFieldUpdater, io.netty5.buffer.Buffer, io.netty5.channel.Channel, .ChannelFutureListeners, .ChannelHandlerContext, io.netty5.handler.codec.http.EmptyLastHttpContent, .FullHttpResponse, .HttpHeaderNames, .HttpObjectAggregator, io.netty5.handler.codec.http.headers.HttpHeaders, io.netty5.handler.codec.http.websocketx.CloseWebSocketFrame, .PingWebSocketFrame, .PongWebSocketFrame, .WebSocketClientHandshakeException, .WebSocketClientHandshaker, .WebSocketClientHandshakerFactory, .WebSocketCloseStatus, org.reactivestreams.Publisher, reactor.core.publisher.Flux, .Mono, .Sinks, reactor.netty5.FutureMono, .NettyOutbound, .ReactorNetty, reactor.netty5.http.websocket.WebsocketInbound, .WebsocketOutbound, reactor.util.annotation.Nullable

Authors
Stephane Maldini, Simon Baslé

Field Summary

Modifier and TypeField and Description
pack-priv static final AtomicIntegerFieldUpdater<WebsocketClientOperations>
pack-priv volatile int
pack-priv final WebSocketClientHandshaker
pack-priv final Sinks.One<WebSocketCloseStatus>
pack-priv final boolean
Inherited from reactor.netty5.http.client.HttpClientOperations:
EMPTY_REDIRECTIONSfollowRedirectPredicateis100ContinueisSecurelogMAX_REDIRECTSnettyRequestpathpreviousRequestHeadersredirectedFromredirectingredirectRequestBiConsumerredirectRequestConsumerrequestHeadersresourceUrlresponseStateresponseTimeoutretryingstartedtrailerHeaders

Constructor Summary

AccessConstructor and Description
pack-priv
WebsocketClientOperations(URI currentURI, WebsocketClientSpec websocketClientSpec, HttpClientOperations replaced)

Method Summary

Modifier and TypeMethod and Description
public HttpHeaders
headers()

Implements reactor.netty5.http.websocket.WebsocketInbound.headers.

Returns the websocket remote headers sent during handshake
public boolean
isWebsocket()

Overrides reactor.netty5.http.client.HttpClientOperations.isWebsocket.

Implements reactor.netty5.http.HttpInfos.isWebsocket.

Returns true if websocket connection (upgraded)
protected void
onInboundCancel()

Overrides reactor.netty5.http.client.HttpClientOperations.onInboundCancel.

React on inbound cancel (receive() subscriber cancelled)
protected void
onInboundClose()

Overrides reactor.netty5.http.client.HttpClientOperations.onInboundClose.

React on inbound close (channel closed prematurely)
public void
protected void
onOutboundComplete()

Overrides reactor.netty5.http.client.HttpClientOperations.onOutboundComplete.

React on inbound/outbound completion (last packet)
protected void
public Mono<WebSocketCloseStatus>
receiveCloseStatus()

Implements reactor.netty5.http.websocket.WebsocketInbound.receiveCloseStatus.

Receive the close status code and reason if sent by the remote peer, or empty if the connection completes otherwise.
public String
selectedSubprotocol()

Implements reactor.netty5.http.websocket.WebsocketInbound.selectedSubprotocol, reactor.netty5.http.websocket.WebsocketOutbound.selectedSubprotocol.

Returns the websocket subprotocol negotiated by the client and server during the websocket handshake, or null if none was requested.
public NettyOutbound
send(Publisher<? extends Buffer>
the dataStream publishing OUT items to write on this channel
dataStream
)

Overrides reactor.netty5.http.client.HttpClientOperations.send.

Overrides default reactor.netty5.NettyOutbound.send.

Implements reactor.netty5.http.websocket.WebsocketOutbound.send.

Sends data to the peer, listens for any error on write and closes on terminal signal (complete|error).
public Mono<Void>
sendClose()

Implements reactor.netty5.http.websocket.WebsocketOutbound.sendClose.

Prepare to send a close frame on subscribe then close the underlying channel
public Mono<Void>
sendClose(int
reserved bits used for protocol extensions
rsv
)

Implements reactor.netty5.http.websocket.WebsocketOutbound.sendClose.

Prepare to send a close frame on subscribe then close the underlying channel
public Mono<Void>
sendClose(int
Integer status code as per RFC 6455#section-7.4. For example, 1000 indicates normal closure.
statusCode
,
String
Reason text. Set to null if no text.
reasonText
)

Implements reactor.netty5.http.websocket.WebsocketOutbound.sendClose.

Prepare to send a close frame on subscribe then close the underlying channel
public Mono<Void>
sendClose(int
reserved bits used for protocol extensions
rsv
,
int
Integer status code as per RFC 6455#section-7.4. For example, 1000 indicates normal closure.
statusCode
,
String
Reason text. Set to null if no text.
reasonText
)

Implements reactor.netty5.http.websocket.WebsocketOutbound.sendClose.

Prepare to send a close frame on subscribe then close the underlying channel
pack-priv Mono<Void>
pack-priv void
pack-priv void
Inherited from reactor.netty5.http.client.HttpClientOperations:
addCookieaddHandlerFirstaddHandlerFirstaddHandlerLastaddHandlerLastaddHeaderaddressafterInboundCompleteafterMarkSentHeadersbeforeMarkSentHeaderschunkedTransfercookiescurrentContextViewfollowRedirectPredicatefullPathgetNettyRequestheaderheadersisFollowRedirectisKeepAlivemethodnewFullBodyMessagenotRedirectedonDisposeonHeadersSentoutboundHttpMessageredirectedFromredirectRequestConsumerremoveHandlerreplaceHandlerrequestHeadersresourceUrlresponseHeadersresponseTimeoutsendsetNettyResponsestatustrailerHeadersuriversionwebsocketUriwithConnectionwithWebsocketSupportwrapInboundError

Field Detail

CLOSE_SENTback to summary
pack-priv static final AtomicIntegerFieldUpdater<WebsocketClientOperations> CLOSE_SENT
closeSentback to summary
pack-priv volatile int closeSent
handshakerback to summary
pack-priv final WebSocketClientHandshaker handshaker
onCloseStateback to summary
pack-priv final Sinks.One<WebSocketCloseStatus> onCloseState
proxyPingback to summary
pack-priv final boolean proxyPing

Constructor Detail

WebsocketClientOperationsback to summary
pack-priv WebsocketClientOperations(URI currentURI, WebsocketClientSpec websocketClientSpec, HttpClientOperations replaced)

Method Detail

headersback to summary
public HttpHeaders headers()

Implements reactor.netty5.http.websocket.WebsocketInbound.headers.

Doc from reactor.netty5.http.websocket.WebsocketInbound.headers.

Returns the websocket remote headers sent during handshake

Returns:HttpHeaders

the websocket remote headers sent during handshake

Annotations
@Override
isWebsocketback to summary
public boolean isWebsocket()

Overrides reactor.netty5.http.client.HttpClientOperations.isWebsocket.

Implements reactor.netty5.http.HttpInfos.isWebsocket.

Doc from reactor.netty5.http.HttpInfos.isWebsocket.

Returns true if websocket connection (upgraded)

Returns:boolean

true if websocket connection

Annotations
@Override
onInboundCancelback to summary
protected void onInboundCancel()

Overrides reactor.netty5.http.client.HttpClientOperations.onInboundCancel.

Doc from reactor.netty5.channel.ChannelOperations.onInboundCancel.

React on inbound cancel (receive() subscriber cancelled)

Annotations
@Override
onInboundCloseback to summary
protected void onInboundClose()

Overrides reactor.netty5.http.client.HttpClientOperations.onInboundClose.

Doc from reactor.netty5.channel.ChannelOperations.onInboundClose.

React on inbound close (channel closed prematurely)

Annotations
@Override
onInboundNextback to summary
public void onInboundNext(ChannelHandlerContext ctx, Object msg)

Overrides reactor.netty5.http.client.HttpClientOperations.onInboundNext.

Doc from reactor.netty5.channel.ChannelOperations.onInboundNext.

React on inbound Channel#read

Parameters
ctx:ChannelHandlerContext

the context

msg:Object

the read payload

Annotations
@Override
onOutboundCompleteback to summary
protected void onOutboundComplete()

Overrides reactor.netty5.http.client.HttpClientOperations.onOutboundComplete.

Doc from reactor.netty5.channel.ChannelOperations.onOutboundComplete.

React on inbound/outbound completion (last packet)

Annotations
@Override
onOutboundErrorback to summary
protected void onOutboundError(Throwable err)

Overrides reactor.netty5.http.client.HttpClientOperations.onOutboundError.

Doc from reactor.netty5.channel.ChannelOperations.onOutboundError.

React on inbound/outbound error

Parameters
err:Throwable

the Throwable cause

Annotations
@Override
receiveCloseStatusback to summary
public Mono<WebSocketCloseStatus> receiveCloseStatus()

Implements reactor.netty5.http.websocket.WebsocketInbound.receiveCloseStatus.

Doc from reactor.netty5.http.websocket.WebsocketInbound.receiveCloseStatus.

Receive the close status code and reason if sent by the remote peer, or empty if the connection completes otherwise.

Note

Some close status codes are designated for use in applications expecting a status code to indicate that the connection was closed etc. They are not meant to be set as a status code in a Close control frame as such these status codes cannot be used with reactor.netty5.http.websocket.WebsocketOutbound#sendClose* methods. Consider checking RFC 6455#section-7.4 for a complete list of the close status codes.

Annotations
@Override
@SuppressWarnings:unchecked
selectedSubprotocolback to summary
public String selectedSubprotocol()

Implements reactor.netty5.http.websocket.WebsocketInbound.selectedSubprotocol, reactor.netty5.http.websocket.WebsocketOutbound.selectedSubprotocol.

Doc from reactor.netty5.http.websocket.WebsocketInbound.selectedSubprotocol.

Returns the websocket subprotocol negotiated by the client and server during the websocket handshake, or null if none was requested.

Returns:String

the subprotocol, or null

Annotations
@Override
@Nullable
sendback to summary
public NettyOutbound send(Publisher<? extends Buffer> dataStream)

Overrides reactor.netty5.http.client.HttpClientOperations.send.

Overrides default reactor.netty5.NettyOutbound.send.

Implements reactor.netty5.http.websocket.WebsocketOutbound.send.

Doc from reactor.netty5.NettyOutbound.send.

Sends data to the peer, listens for any error on write and closes on terminal signal (complete|error).

A new NettyOutbound type (or the same) for typed send sequences.

Note

Nesting any send* method is not supported.

Parameters
dataStream:Publisher<? extends Buffer>

the dataStream publishing OUT items to write on this channel

Returns:NettyOutbound

A new NettyOutbound to append further send. It will emit a complete signal successful sequence write (e.g. after "flush") or any error during write.

Annotations
@Override
sendCloseback to summary
public Mono<Void> sendClose()

Implements reactor.netty5.http.websocket.WebsocketOutbound.sendClose.

Doc from reactor.netty5.http.websocket.WebsocketOutbound.sendClose.

Prepare to send a close frame on subscribe then close the underlying channel

Returns:Mono<Void>

a Mono fulfilled when the send succeeded or failed, immediately completed if already closed

Annotations
@Override
sendCloseback to summary
public Mono<Void> sendClose(int rsv)

Implements reactor.netty5.http.websocket.WebsocketOutbound.sendClose.

Doc from reactor.netty5.http.websocket.WebsocketOutbound.sendClose.

Prepare to send a close frame on subscribe then close the underlying channel

Parameters
rsv:int

reserved bits used for protocol extensions

Returns:Mono<Void>

a Mono fulfilled when the send succeeded or failed, immediately completed if already closed

Annotations
@Override
sendCloseback to summary
public Mono<Void> sendClose(int statusCode, String reasonText)

Implements reactor.netty5.http.websocket.WebsocketOutbound.sendClose.

Doc from reactor.netty5.http.websocket.WebsocketOutbound.sendClose.

Prepare to send a close frame on subscribe then close the underlying channel

Parameters
statusCode:int

Integer status code as per RFC 6455#section-7.4. For example, 1000 indicates normal closure.

reasonText:String

Reason text. Set to null if no text.

Returns:Mono<Void>

a Mono fulfilled when the send succeeded or failed, immediately completed if already closed

Annotations
@Override
sendCloseback to summary
public Mono<Void> sendClose(int rsv, int statusCode, String reasonText)

Implements reactor.netty5.http.websocket.WebsocketOutbound.sendClose.

Doc from reactor.netty5.http.websocket.WebsocketOutbound.sendClose.

Prepare to send a close frame on subscribe then close the underlying channel

Parameters
rsv:int

reserved bits used for protocol extensions

statusCode:int

Integer status code as per RFC 6455#section-7.4. For example, 1000 indicates normal closure.

reasonText:String

Reason text. Set to null if no text.

Returns:Mono<Void>

a Mono fulfilled when the send succeeded or failed, immediately completed if already closed

Annotations
@Override
sendCloseback to summary
pack-priv Mono<Void> sendClose(CloseWebSocketFrame frame)
sendCloseNowback to summary
pack-priv void sendCloseNow(CloseWebSocketFrame frame)
sendCloseNowback to summary
pack-priv void sendCloseNow(CloseWebSocketFrame frame, WebSocketCloseStatus closeStatus)