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

public final Class TcpServerTransport

extends Object
implements ServerTransport<CloseableChannel>
Class Inheritance
All Implemented Interfaces
io.rsocket.transport.ServerTransport, io.rsocket.transport.Transport
Static Imports
io.rsocket.frame.FrameLengthCodec.FRAME_LENGTH_MASK

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

Field Summary

Modifier and TypeField and Description
private final int
private final TcpServer

Constructor Summary

AccessConstructor and Description
private
TcpServerTransport(TcpServer server, int maxFrameLength)

Method Summary

Modifier and TypeMethod and Description
public static TcpServerTransport

Returns:

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

Creates a new instance binding to localhost

public static TcpServerTransport

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 TcpServerTransport

Returns:

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

Creates a new instance

public static TcpServerTransport

Returns:

a new instance
create
(TcpServer
the TcpServer to use
server
)

Creates a new instance

public static TcpServerTransport

Returns:

a new instance
create
(TcpServer
the TcpServer to use
server
,
int
max frame length being sent over the connection
maxFrameLength
)

Creates a new instance

public int
maxFrameLength()

Overrides default io.rsocket.transport.Transport.maxFrameLength.

Configurations that exposes the maximum frame size that a DuplexConnection can bring up to RSocket level.
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 java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

maxFrameLengthback to summary
private final int maxFrameLength
serverback to summary
private final TcpServer server

Constructor Detail

TcpServerTransportback to summary
private TcpServerTransport(TcpServer server, int maxFrameLength)

Method Detail

createback to summary
public static TcpServerTransport create(int port)

Creates a new instance binding to localhost

Parameters
port:int

the port to bind to

Returns:TcpServerTransport

a new instance

createback to summary
public static TcpServerTransport 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:TcpServerTransport

a new instance

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

Creates a new instance

Parameters
address:InetSocketAddress

the address to bind to

Returns:TcpServerTransport

a new instance

Exceptions
NullPointerException:
if address is null
createback to summary
public static TcpServerTransport create(TcpServer server)

Creates a new instance

Parameters
server:TcpServer

the TcpServer to use

Returns:TcpServerTransport

a new instance

Exceptions
NullPointerException:
if server is null
createback to summary
public static TcpServerTransport create(TcpServer server, int maxFrameLength)

Creates a new instance

Parameters
server:TcpServer

the TcpServer to use

maxFrameLength:int

max frame length being sent over the connection

Returns:TcpServerTransport

a new instance

Exceptions
NullPointerException:
if server is null
maxFrameLengthback to summary
public int maxFrameLength()

Overrides default io.rsocket.transport.Transport.maxFrameLength.

Doc from io.rsocket.transport.Transport.maxFrameLength.

Configurations that exposes the maximum frame size that a DuplexConnection can bring up to RSocket level.

This number should not exist the 16,777,215 (maximum frame size specified by RSocket spec)

Returns:int

return maximum configured frame size limit

Annotations
@Override
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