bind() is ultimately called.
Example:
TcpServer.create()
.doOnBind(startMetrics)
.doOnBound(startedMetrics)
.doOnUnbound(stopMetrics)
.host("127.0.0.1")
.port(1234)
.bind()
.block()
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Logger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public TcpServer | bindAddress(Supplier<? extends SocketAddress>
A supplier of the address to bind to. bindAddressSupplier)
Set a new local address to which this transport should bind on subscribe.
|
| public TcpServer | channelGroup(ChannelGroup channelGroup)
Overrides reactor. ChannelGroup to hold all active connected channels.
|
| public static TcpServer | |
| public TcpServer | doOnBind(Consumer<? super TcpServerConfig>
a consumer observing connected events doOnBind)Overrides reactor. ServerTransport is about to start listening for incoming traffic.
|
| public TcpServer | doOnBound(Consumer<? super DisposableServer>
a consumer observing connected events doOnBound)Overrides reactor. DisposableServer has been started.
|
| public TcpServer | doOnConnection(Consumer<? super Connection>
a consumer observing remote connections doOnConnection)Overrides reactor. Connection.
|
| public TcpServer | doOnUnbound(Consumer<? super DisposableServer>
a consumer observing unbound events doOnUnbound)Overrides reactor. DisposableServer has been shutdown.
|
| public TcpServer | Returns: a newTcpServeran I/O handler that can dispose underlying connection when
handler)Publisher terminates.Attaches an I/O handler to react on a connected client. |
| public TcpServer | host(String
the host to bind to. host)Overrides reactor. |
| public TcpServer | metrics(boolean
true enables metrics collection; false disables it enable)Overrides reactor. globalRegistry.
|
| public TcpServer | metrics(boolean
if true enables the metrics on the enable, Supplier<? extends ChannelMetricsRecorder> Transport.a supplier for the recorder)ChannelMetricsRecorderOverrides reactor. Transport.
|
| public TcpServer | |
| public TcpServer | port(int
The port to bind to. port)Overrides reactor. |
| public TcpServer | runOn(EventLoopGroup
an eventLoopGroup to share eventLoopGroup)Overrides reactor. EventLoopGroup.
|
| public TcpServer | runOn(LoopResources
a channelResources)LoopResources accepting native runtime expectation and
returning an eventLoopGroupOverrides reactor. EventLoopGroup from the LoopResources container.
|
| public TcpServer | runOn(LoopResources
a new loop resources loopResources, boolean should prefer running on epoll, kqueue or similar instead of java NIO preferNative)Overrides reactor. EventLoopGroup from the LoopResources container.
|
| public TcpServer | Returns: a newTcpServerbuilder callback for further customization of SslContext. sslProviderBuilder)Apply an SSL configuration customization via the passed builder. |
| public TcpServer | Returns: a newTcpServerThe provider to set when configuring SSL sslProvider)Applies an SSL configuration via the passed |
| public Mono | Returns: aMono representing the completion of the warmupOverrides reactor. Mono that triggers:
|
| public TcpServer | wiretap(boolean
specifies whether the wire logger configuration will be added to the pipeline enable)Overrides reactor. Transport category (logger),
DEBUG logger level and AdvancedByteBufFormat#HEX_DUMP for ByteBuf format,
which means both events and content will be logged and the content will be in hex format.
|
| public TcpServer | wiretap(String
the logger category category)Overrides reactor. DEBUG logger level and AdvancedByteBufFormat#HEX_DUMP for ByteBuf format,
which means both events and content will be logged and the content will be in hex format.
|
| public TcpServer | wiretap(String
the logger category category, LogLevel the logger level level)Overrides reactor. AdvancedByteBufFormat#HEX_DUMP for ByteBuf format,
which means both events and content will be logged and the content will be in hex format.
|
| log | back to summary |
|---|---|
| pack-priv static final Logger log | |
| TcpServer | back to summary |
|---|---|
| public TcpServer() | |
| bindAddress | back to summary |
|---|---|
| public TcpServer bindAddress(Supplier<? extends SocketAddress> bindAddressSupplier) Overrides reactor. Doc from reactor. Set a new local address to which this transport should bind on subscribe.
| |
| channelGroup | back to summary |
|---|---|
| public TcpServer channelGroup(ChannelGroup channelGroup) Overrides reactor. Doc from reactor. Provide a Graceful Shutdown: When a
| |
| create | back to summary |
|---|---|
| public static TcpServer create() Prepare a | |
| doOnBind | back to summary |
|---|---|
| public TcpServer doOnBind(Consumer<? super TcpServerConfig> doOnBind) Overrides reactor. Doc from reactor. Set or add a callback called when
| |
| doOnBound | back to summary |
|---|---|
| public TcpServer doOnBound(Consumer<? super DisposableServer> doOnBound) Overrides reactor. Doc from reactor. Set or add a callback called after
| |
| doOnConnection | back to summary |
|---|---|
| public TcpServer doOnConnection(Consumer<? super Connection> doOnConnection) Overrides reactor. Doc from reactor. Set or add a callback called on new remote
| |
| doOnUnbound | back to summary |
|---|---|
| public TcpServer doOnUnbound(Consumer<? super DisposableServer> doOnUnbound) Overrides reactor. Doc from reactor. Set or add a callback called after
| |
| handle | back to summary |
|---|---|
| public TcpServer handle(BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>> handler) Attaches an I/O handler to react on a connected client.
| |
| host | back to summary |
|---|---|
| public TcpServer host(String host) Overrides reactor. Doc from reactor. The host to which this server should bind.
| |
| metrics | back to summary |
|---|---|
| public TcpServer metrics(boolean enable) Overrides reactor. Doc from reactor. Whether to enable metrics to be collected and registered in Micrometer's
MeterFilter filter = ... ; Metrics.globalRegistry.config().meterFilter(MeterFilter.maximumAllowableTags(prefix, 100, filter)); By default this is not enabled. | |
| metrics | back to summary |
|---|---|
| public TcpServer metrics(boolean enable, Supplier<? extends ChannelMetricsRecorder> recorder) Overrides reactor. Doc from reactor. Specifies whether the metrics are enabled on the
| |
| noSSL | back to summary |
|---|---|
| public TcpServer noSSL() Removes any previously applied SSL configuration customization. | |
| port | back to summary |
|---|---|
| public TcpServer port(int port) Overrides reactor. Doc from reactor. The port to which this server should bind.
| |
| runOn | back to summary |
|---|---|
| public TcpServer runOn(EventLoopGroup eventLoopGroup) Overrides reactor. Doc from reactor. Run IO loops on the given
| |
| runOn | back to summary |
|---|---|
| public TcpServer runOn(LoopResources channelResources) Overrides reactor. Doc from reactor. Run IO loops on a supplied
| |
| runOn | back to summary |
|---|---|
| public TcpServer runOn(LoopResources loopResources, boolean preferNative) Overrides reactor. Doc from reactor. Run IO loops on a supplied
| |
| secure | back to summary |
|---|---|
| public TcpServer secure(Consumer<? super SslProvider. Apply an SSL configuration customization via the passed builder. The builder
will produce the
SelfSignedCertificate needs to be used, the sample below can be
used. Note that SelfSignedCertificate should not be used in production.
| |
| secure | back to summary |
|---|---|
| public TcpServer secure(SslProvider sslProvider) Applies an SSL configuration via the passed
| |
| warmup | back to summary |
|---|---|
| public Mono Overrides reactor. Based on the actual configuration, returns a
bind operation absorbs the extra time needed to load resources.
| |
| wiretap | back to summary |
|---|---|
| public TcpServer wiretap(boolean enable) Overrides reactor. Doc from reactor. Apply or remove a wire logger configuration using | |
| wiretap | back to summary |
|---|---|
| public TcpServer wiretap(String category) Overrides reactor. Doc from reactor. Apply a wire logger configuration using the specified category (logger),
| |
| wiretap | back to summary |
|---|---|
| public TcpServer wiretap(String category, LogLevel level) Overrides reactor. Doc from reactor. Apply a wire logger configuration using the specified category (logger),
logger level and | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final BiFunction |
| Access | Constructor and Description |
|---|---|
| pack-priv | OnConnectionHandle(BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>> handler)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(Connection
the input argument c)Implements java. |
| handler | back to summary |
|---|---|
| pack-priv final BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>> handler | |
| OnConnectionHandle | back to summary |
|---|---|
| pack-priv OnConnectionHandle(BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>> handler) | |
| accept | back to summary |
|---|---|
| public void accept(Connection c) Implements java. Doc from java. Performs this operation on the given argument.
| |