Search in sources :

Example 1 with UdpClient

use of reactor.netty.udp.UdpClient in project reactor-netty by reactor.

the class Application method main.

public static void main(String[] args) {
    UdpClient udpClient = UdpClient.create().host("example.com").port(80).handle((udpInbound, udpOutbound) -> udpOutbound.sendString(Mono.just("hello")));
    // <1>
    udpClient.warmup().block();
    // <2>
    Connection connection = udpClient.connectNow(Duration.ofSeconds(30));
    connection.onDispose().block();
}
Also used : Connection(reactor.netty.Connection) UdpClient(reactor.netty.udp.UdpClient)

Aggregations

Connection (reactor.netty.Connection)1 UdpClient (reactor.netty.udp.UdpClient)1