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

public final Class WebsocketServerTransport

extends BaseWebsocketServerTransport<WebsocketServerTransport, CloseableChannel>
Class Inheritance
Imports
io.netty.handler.codec.http.DefaultHttpHeaders, .HttpHeaders, io.rsocket.transport.ClientTransport, .ServerTransport, io.rsocket.transport.netty.WebsocketDuplexConnection, java.net.InetSocketAddress, java.util.Arrays, .Objects, reactor.core.publisher.Mono, reactor.netty.Connection, reactor.netty.http.server.HttpServer

An implementation of ServerTransport that connects to a ClientTransport via a Websocket.

Field Summary

Modifier and TypeField and Description
private HttpHeaders
private final HttpServer
Inherited from io.rsocket.transport.netty.server.BaseWebsocketServerTransport:
serverConfigurerspecBuilder

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static WebsocketServerTransport

Returns:

a new instance
create
(int
the port to bind to
port
)

Creates a new instance binding to localhost

public static WebsocketServerTransport

Returns:

a new instance
create
(String
the address to bind to
bindAddress
,
int
the port to bind to
port
)

Creates a new instance

public static WebsocketServerTransport

Returns:

a new instance
create
(InetSocketAddress
the address to bind to
address
)

Creates a new instance

public static WebsocketServerTransport

Returns:

a new instance
create
(final HttpServer
the HttpServer to use
server
)

Creates a new instance

public WebsocketServerTransport

Returns:

the same instance for method chaining
header
(String
the header name
name
,
String...
the header value(s)
values
)

Add a header and value(s) to set on the response of WebSocket handshakes.

public Mono<CloseableChannel>
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

headersback to summary
private HttpHeaders headers
serverback to summary
private final HttpServer server

Constructor Detail

WebsocketServerTransportback to summary
private WebsocketServerTransport(HttpServer server)

Method Detail

createback to summary
public static WebsocketServerTransport create(int port)

Creates a new instance binding to localhost

Parameters
port:int

the port to bind to

Returns:WebsocketServerTransport

a new instance

createback to summary
public static WebsocketServerTransport create(String bindAddress, int port)

Creates a new instance

Parameters
bindAddress:String

the address to bind to

port:int

the port to bind to

Returns:WebsocketServerTransport

a new instance

Exceptions
NullPointerException:
if bindAddress is null
createback to summary
public static WebsocketServerTransport create(InetSocketAddress address)

Creates a new instance

Parameters
address:InetSocketAddress

the address to bind to

Returns:WebsocketServerTransport

a new instance

Exceptions
NullPointerException:
if address is null
createback to summary
public static WebsocketServerTransport create(final HttpServer server)

Creates a new instance

Parameters
server:HttpServer

the HttpServer to use

Returns:WebsocketServerTransport

a new instance

Exceptions
NullPointerException:
if server is null
headerback to summary
public WebsocketServerTransport header(String name, String... values)

Add a header and value(s) to set on the response of WebSocket handshakes.

Parameters
name:String

the header name

values:String[]

the header value(s)

Returns:WebsocketServerTransport

the same instance for method chaining

Since
1.0.1
startback to summary
public Mono<CloseableChannel> 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<CloseableChannel>

A handle for information about and control over the server.

Annotations
@Override