public abstract class UdpClient
extends java.lang.Object
connect(Bootstrap) is ultimately called.
 
 Internally, materialization happens in two phases, first configure() is
 called to retrieve a ready to use Bootstrap then connect(Bootstrap)
 is called.
 
Example:
 
 UdpClient.create()
          .doOnConnect(startMetrics)
          .doOnConnected(startedMetrics)
          .doOnDisconnected(stopMetrics)
          .host("127.0.0.1")
          .port(1234)
          .connect()
          .block()
 | Constructor and Description | 
|---|
UdpClient()  | 
| Modifier and Type | Method and Description | 
|---|---|
UdpClient | 
addressSupplier(java.util.function.Supplier<? extends java.net.SocketAddress> connectingAddressSupplier)
The address to which this client should connect on subscribe. 
 | 
<T> UdpClient | 
attr(io.netty.util.AttributeKey<T> key,
    T value)
Inject default attribute to the future child  
Channel connections. | 
UdpClient | 
bootstrap(java.util.function.Function<? super io.netty.bootstrap.Bootstrap,? extends io.netty.bootstrap.Bootstrap> bootstrapMapper)
Apply  
Bootstrap configuration given mapper taking currently configured one
 and returning a new one to be ultimately used for socket binding. | 
protected io.netty.bootstrap.Bootstrap | 
configure()
Materialize a Bootstrap from the parent  
UdpClient chain to use with connect(Bootstrap) or separately | 
reactor.core.publisher.Mono<? extends Connection> | 
connect()
 | 
protected abstract reactor.core.publisher.Mono<? extends Connection> | 
connect(io.netty.bootstrap.Bootstrap b)
 | 
Connection | 
connectNow(java.time.Duration timeout)
Block the  
UdpClient and return a Connection. | 
static UdpClient | 
create()
Prepare a  
UdpClient | 
UdpClient | 
doOnConnect(java.util.function.Consumer<? super io.netty.bootstrap.Bootstrap> doOnConnect)
Setup a callback called when  
Channel is about to
 connect. | 
UdpClient | 
doOnConnected(java.util.function.Consumer<? super Connection> doOnConnected)
Setup a callback called when  
Channel is
 connected. | 
UdpClient | 
doOnDisconnected(java.util.function.Consumer<? super Connection> doOnDisconnected)
Setup a callback called when  
Channel is
 disconnected. | 
UdpClient | 
doOnLifecycle(java.util.function.Consumer<? super io.netty.bootstrap.Bootstrap> doOnConnect,
             java.util.function.Consumer<? super Connection> doOnConnected,
             java.util.function.Consumer<? super Connection> doOnDisconnected)
Setup all lifecycle callbacks called on or after  
Channel
 has been connected and after it has been disconnected. | 
UdpClient | 
handle(java.util.function.BiFunction<? super UdpInbound,? super UdpOutbound,? extends Publisher<java.lang.Void>> handler)
Attach an IO handler to react on connected client 
 | 
UdpClient | 
host(java.lang.String host)
The host to which this client should connect. 
 | 
UdpClient | 
observe(ConnectionObserver observer)
Setup all lifecycle callbacks called on or after  
Channel
 has been connected and after it has been disconnected. | 
<T> UdpClient | 
option(io.netty.channel.ChannelOption<T> key,
      T value)
Set a  
ChannelOption value for low level connection settings like SO_TIMEOUT
 or SO_KEEPALIVE. | 
UdpClient | 
port(int port)
The port to which this client should connect. 
 | 
UdpClient | 
runOn(io.netty.channel.EventLoopGroup eventLoopGroup)
Run IO loops on the given  
EventLoopGroup. | 
UdpClient | 
runOn(LoopResources channelResources)
Run IO loops on a supplied  
EventLoopGroup from the LoopResources
 container. | 
UdpClient | 
runOn(LoopResources channelResources,
     boolean preferNative)
Run IO loops on a supplied  
EventLoopGroup from the LoopResources
 container. | 
UdpClient | 
runOn(LoopResources channelResources,
     io.netty.channel.socket.InternetProtocolFamily family)
Run IO loops on a supplied  
EventLoopGroup from the LoopResources
 container. | 
UdpClient | 
wiretap()
Deprecated. 
 
Use  
wiretap(boolean) | 
UdpClient | 
wiretap(boolean enable)
Apply or remove a wire logger configuration using  
UdpClient category
 and DEBUG logger level | 
UdpClient | 
wiretap(java.lang.String category)
Apply a wire logger configuration using the specified category
 and  
DEBUG logger level | 
UdpClient | 
wiretap(java.lang.String category,
       io.netty.handler.logging.LogLevel level)
Apply a wire logger configuration using the specified category
 and logger level 
 | 
public final UdpClient addressSupplier(java.util.function.Supplier<? extends java.net.SocketAddress> connectingAddressSupplier)
connectingAddressSupplier - A supplier of the address to connect to.UdpClientpublic final <T> UdpClient attr(io.netty.util.AttributeKey<T> key, T value)
Channel connections. They
 will be available via AttributeMap.attr(AttributeKey).T - the attribute typekey - the attribute keyvalue - the attribute valueUdpClientAbstractBootstrap.attr(AttributeKey, Object)public final UdpClient bootstrap(java.util.function.Function<? super io.netty.bootstrap.Bootstrap,? extends io.netty.bootstrap.Bootstrap> bootstrapMapper)
Bootstrap configuration given mapper taking currently configured one
 and returning a new one to be ultimately used for socket binding.  Configuration
 will apply during configure() phase.
bootstrapMapper - A bootstrap mapping function to update configuration and return an
 enriched bootstrap.UdpClientpublic final reactor.core.publisher.Mono<? extends Connection> connect()
UdpClient and return a Mono of Connection. If
 Mono is cancelled, the underlying connection will be aborted. Once the Connection has been emitted and is not necessary anymore, disposing main client
 loop must be done by the user via DisposableChannel.dispose().
 If update configuration phase fails, a Mono.error(Throwable) will be returnedMono of Connectionpublic final Connection connectNow(java.time.Duration timeout)
UdpClient and return a Connection. Disposing must be
 done by the user via DisposableChannel.dispose().timeout - connect timeoutMono of Connectionpublic final UdpClient doOnConnect(java.util.function.Consumer<? super io.netty.bootstrap.Bootstrap> doOnConnect)
Channel is about to
 connect.doOnConnect - a consumer observing client start eventUdpClientpublic final UdpClient doOnConnected(java.util.function.Consumer<? super Connection> doOnConnected)
Channel is
 connected.doOnConnected - a consumer observing client started eventUdpClientpublic final UdpClient doOnDisconnected(java.util.function.Consumer<? super Connection> doOnDisconnected)
Channel is
 disconnected.doOnDisconnected - a consumer observing client stop eventUdpClientpublic final UdpClient doOnLifecycle(java.util.function.Consumer<? super io.netty.bootstrap.Bootstrap> doOnConnect, java.util.function.Consumer<? super Connection> doOnConnected, java.util.function.Consumer<? super Connection> doOnDisconnected)
Channel
 has been connected and after it has been disconnected.doOnConnect - a consumer observing client start eventdoOnConnected - a consumer observing client started eventdoOnDisconnected - a consumer observing client stop eventUdpClientpublic final UdpClient host(java.lang.String host)
host - The host to connect to.UdpClientpublic final UdpClient handle(java.util.function.BiFunction<? super UdpInbound,? super UdpOutbound,? extends Publisher<java.lang.Void>> handler)
public final UdpClient observe(ConnectionObserver observer)
Channel
 has been connected and after it has been disconnected.observer - a consumer observing state changesUdpClientpublic final <T> UdpClient option(io.netty.channel.ChannelOption<T> key, T value)
ChannelOption value for low level connection settings like SO_TIMEOUT
 or SO_KEEPALIVE. This will apply to each new channel from remote peer.T - the option typekey - the option keyvalue - the option valueUdpClientAbstractBootstrap.option(ChannelOption, Object)public final UdpClient port(int port)
port - The port to connect to.UdpClientpublic final UdpClient runOn(io.netty.channel.EventLoopGroup eventLoopGroup)
EventLoopGroup.eventLoopGroup - an eventLoopGroup to shareUdpClientpublic final UdpClient runOn(LoopResources channelResources)
EventLoopGroup from the LoopResources
 container. Will prefer native (epoll/kqueue) implementation if available unless the
 environment property reactor.netty.native is set to false.channelResources - a LoopResources accepting native runtime
 expectation and returning an eventLoopGroupUdpClientpublic final UdpClient runOn(LoopResources channelResources, boolean preferNative)
EventLoopGroup from the LoopResources
 container.channelResources - a LoopResources accepting native runtime
 expectation and returning an eventLoopGroup.preferNative - Should the connector prefer native (epoll/kqueue) if available.UdpClientpublic final UdpClient runOn(LoopResources channelResources, io.netty.channel.socket.InternetProtocolFamily family)
EventLoopGroup from the LoopResources
 container.channelResources - a LoopResources accepting native runtime
 expectation and returning an eventLoopGroup.family - a specific InternetProtocolFamily to run withUdpClient@Deprecated public final UdpClient wiretap()
wiretap(boolean)UdpClient category
 and DEBUG logger levelUdpClientpublic final UdpClient wiretap(boolean enable)
UdpClient category
 and DEBUG logger levelenable - Specifies whether the wire logger configuration will be added to
               the pipelineUdpClientpublic final UdpClient wiretap(java.lang.String category)
DEBUG logger levelcategory - the logger categoryUdpClientpublic final UdpClient wiretap(java.lang.String category, io.netty.handler.logging.LogLevel level)
category - the logger categorylevel - the logger levelUdpClientprotected io.netty.bootstrap.Bootstrap configure()
UdpClient chain to use with connect(Bootstrap) or separatelyBootstrapprotected abstract reactor.core.publisher.Mono<? extends Connection> connect(io.netty.bootstrap.Bootstrap b)
b - the Bootstrap to connectMono of Connection