public abstract class NetServerSpec<IN,OUT,S extends NetServerSpec<IN,OUT,S,N>,N extends NetServer<IN,OUT>>
extends reactor.core.spec.support.EventRoutingComponentSpec<S,N>
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Collection<reactor.function.Consumer<NetChannel<IN,OUT>>> |
channelConsumers |
protected reactor.io.encoding.Codec<reactor.io.Buffer,IN,OUT> |
codec |
protected java.net.InetSocketAddress |
listenAddress |
protected ServerSocketOptions |
options |
| Constructor and Description |
|---|
NetServerSpec() |
| Modifier and Type | Method and Description |
|---|---|
S |
codec(reactor.io.encoding.Codec<reactor.io.Buffer,IN,OUT> codec)
The
Codec to use to encode and decode data. |
S |
consume(java.util.Collection<reactor.function.Consumer<NetChannel<IN,OUT>>> channelConsumers)
Callbacks to invoke when a new channel is created.
|
S |
consume(reactor.function.Consumer<NetChannel<IN,OUT>> channelConsumer)
Callback to invoke when a new channel is created.
|
S |
consumeInput(reactor.function.Consumer<IN> inputConsumer)
Callback to invoke when a new input message is created.
|
S |
listen(java.net.InetSocketAddress listenAddress)
The
InetSocketAddress on which this server should listen. |
S |
listen(int port)
The port on which this server should listen, assuming it should bind to all available addresses.
|
S |
listen(java.lang.String host,
int port)
The host and port on which this server should listen.
|
S |
options(ServerSocketOptions options)
Set the common
ServerSocketOptions for channels made in this server. |
broadcastEventRouting, configure, configure, consumerInvoker, consumerNotFoundHandler, consumerRegistry, converters, converters, dispatchErrorHandler, eventFilter, eventRouter, firstEventRouting, randomEventRouting, roundRobinEventRouting, traceEventPath, traceEventPath, uncaughtErrorHandlerprotected ServerSocketOptions options
protected java.util.Collection<reactor.function.Consumer<NetChannel<IN,OUT>>> channelConsumers
protected java.net.InetSocketAddress listenAddress
public S options(@Nonnull ServerSocketOptions options)
ServerSocketOptions for channels made in this server.options - The options to set when new channels are made.public S listen(int port)
port - The port to listen on.public S listen(java.lang.String host, int port)
host - The host to bind to.port - The port to listen on.public S listen(java.net.InetSocketAddress listenAddress)
InetSocketAddress on which this server should listen.listenAddress - the listen addresspublic S codec(@Nonnull reactor.io.encoding.Codec<reactor.io.Buffer,IN,OUT> codec)
Codec to use to encode and decode data.codec - The codec to use.public S consumeInput(@Nonnull reactor.function.Consumer<IN> inputConsumer)
inputConsumer - The callback to invoke for new messages.public S consume(@Nonnull reactor.function.Consumer<NetChannel<IN,OUT>> channelConsumer)
channelConsumer - The callback to invoke for new channels.public S consume(@Nonnull java.util.Collection<reactor.function.Consumer<NetChannel<IN,OUT>>> channelConsumers)
channelConsumers - The callbacks to invoke for new channels.