Top Description Fields Constructors Methods
io.rsocket.transport.netty.server

public final Class WebsocketRouteTransport

extends BaseWebsocketServerTransport<WebsocketRouteTransport, Closeable>
Class Inheritance
Imports
io.rsocket.Closeable, io.rsocket.transport.ServerTransport, io.rsocket.transport.netty.WebsocketDuplexConnection, java.util.Objects, java.util.function.BiFunction, .Consumer, org.reactivestreams.Publisher, reactor.core.publisher.Mono, reactor.netty.Connection, reactor.netty.http.server.HttpServer, .HttpServerRoutes, reactor.netty.http.websocket.WebsocketInbound, .WebsocketOutbound

An implementation of ServerTransport that connects via Websocket and listens on specified routes.

Field Summary

Modifier and TypeField and Description
private final String
private final Consumer<? super HttpServerRoutes>
private final HttpServer
Inherited from io.rsocket.transport.netty.server.BaseWebsocketServerTransport:
serverConfigurerspecBuilder

Constructor Summary

AccessConstructor and Description
public
WebsocketRouteTransport(HttpServer
the HttpServer to use
server
,
Consumer<? super HttpServerRoutes>
the builder for the routes that will be listened on
routesBuilder
,
String
the path foe each route
path
)

Creates a new instance

Method Summary

Modifier and TypeMethod and Description
public static BiFunction<WebsocketInbound, WebsocketOutbound, Publisher<Void>>

Returns:

a new Websocket handler
newHandler
(ServerTransport.ConnectionAcceptor
the ConnectionAcceptor to use with the handler
acceptor
)

Creates a new Websocket handler

public Mono<Closeable>
start(ServerTransport.ConnectionAcceptor
to process a newly accepted connections with
acceptor
)

Implements io.rsocket.transport.ServerTransport.start.

Start this server.
Inherited from io.rsocket.transport.netty.server.BaseWebsocketServerTransport:
maxFrameLengthwebSocketSpec

Field Detail

pathback to summary
private final String path
routesBuilderback to summary
private final Consumer<? super HttpServerRoutes> routesBuilder
serverback to summary
private final HttpServer server

Constructor Detail

WebsocketRouteTransportback to summary
public WebsocketRouteTransport(HttpServer server, Consumer<? super HttpServerRoutes> routesBuilder, String path)

Creates a new instance

Parameters
server:HttpServer

the HttpServer to use

routesBuilder:Consumer<? super HttpServerRoutes>

the builder for the routes that will be listened on

path:String

the path foe each route

Method Detail

newHandlerback to summary
public static BiFunction<WebsocketInbound, WebsocketOutbound, Publisher<Void>> newHandler(ServerTransport.ConnectionAcceptor acceptor)

Creates a new Websocket handler

Parameters
acceptor:ServerTransport.ConnectionAcceptor

the ConnectionAcceptor to use with the handler

Returns:BiFunction<WebsocketInbound, WebsocketOutbound, Publisher<Void>>

a new Websocket handler

Exceptions
NullPointerException:
if acceptor is null
startback to summary
public Mono<Closeable> start(ServerTransport.ConnectionAcceptor acceptor)

Implements io.rsocket.transport.ServerTransport.start.

Doc from io.rsocket.transport.ServerTransport.start.

Start this server.

Parameters
acceptor:ServerTransport.ConnectionAcceptor

to process a newly accepted connections with

Returns:Mono<Closeable>

A handle for information about and control over the server.

Annotations
@Override