接口 RequestUpgradeStrategy
- 所有已知实现类:
JettyRequestUpgradeStrategy
,ReactorNettyRequestUpgradeStrategy
,TomcatRequestUpgradeStrategy
,UndertowRequestUpgradeStrategy
public interface RequestUpgradeStrategy
A strategy for upgrading an HTTP request to a WebSocket session depending on the underlying network runtime.Typically there is one such strategy for every
ServerHttpRequest
andServerHttpResponse
type except in the case of Servlet containers for which the standard Java WebSocket API JSR-356 does not define a way to upgrade a request so a custom strategy is needed for every Servlet container.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
方法概要
所有方法 实例方法 默认方法 已过时的方法 修饰符和类型 方法 说明 default reactor.core.publisher.Mono<Void>
upgrade(ServerWebExchange exchange, WebSocketHandler webSocketHandler, String subProtocol)
已过时。as of 5.1 in favor ofupgrade(ServerWebExchange, WebSocketHandler, String, Supplier)
default reactor.core.publisher.Mono<Void>
upgrade(ServerWebExchange exchange, WebSocketHandler webSocketHandler, String subProtocol, Supplier<HandshakeInfo> handshakeInfoFactory)
Upgrade to a WebSocket session and handle it with the given handler.
方法详细资料
upgrade
@Deprecated default reactor.core.publisher.Mono<Void> upgrade(ServerWebExchange exchange, WebSocketHandler webSocketHandler, @Nullable String subProtocol)
已过时。as of 5.1 in favor ofupgrade(ServerWebExchange, WebSocketHandler, String, Supplier)
Upgrade to a WebSocket session and handle it with the given handler.- 参数:
exchange
- the current exchangewebSocketHandler
- handler for the WebSocket sessionsubProtocol
- the selected sub-protocol got the handler- 返回:
- completion
Mono<Void>
to indicate the outcome of the WebSocket session handling.
upgrade
default reactor.core.publisher.Mono<Void> upgrade(ServerWebExchange exchange, WebSocketHandler webSocketHandler, @Nullable String subProtocol, Supplier<HandshakeInfo> handshakeInfoFactory)
Upgrade to a WebSocket session and handle it with the given handler.- 参数:
exchange
- the current exchangewebSocketHandler
- handler for the WebSocket sessionsubProtocol
- the selected sub-protocol got the handlerhandshakeInfoFactory
- factory to create HandshakeInfo for the WebSocket session- 返回:
- completion
Mono<Void>
to indicate the outcome of the WebSocket session handling. - 从以下版本开始:
- 5.1