use of reactor.netty.Connection in project reactor-netty by reactor.
the class Application method main.
public static void main(String[] args) {
Connection connection = UdpClient.create().host("example.com").port(80).doOnConnected(// <1>
conn -> conn.addHandler(new LineBasedFrameDecoder(8192))).doOnChannelInit((observer, channel, remoteAddress) -> channel.pipeline().addFirst(// <2>
new LoggingHandler("reactor.netty.examples"))).connectNow(Duration.ofSeconds(30));
connection.onDispose().block();
}
use of reactor.netty.Connection in project reactor-netty by reactor.
the class Application method main.
public static void main(String[] args) {
Connection connection = UdpClient.create().host("example.com").port(80).metrics(true, // <1>
CustomChannelMetricsRecorder::new).connectNow(Duration.ofSeconds(30));
connection.onDispose().block();
}
use of reactor.netty.Connection 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();
}
use of reactor.netty.Connection in project reactor-netty by reactor.
the class Application method main.
public static void main(String[] args) {
Connection connection = UdpClient.create().host("example.com").port(80).wiretap("logger-name", LogLevel.DEBUG, // <1>
AdvancedByteBufFormat.TEXTUAL).connectNow(Duration.ofSeconds(30));
connection.onDispose().block();
}
use of reactor.netty.Connection in project reactor-netty by reactor.
the class Application method main.
public static void main(String[] args) {
Connection connection = UdpClient.create().host("example.com").port(80).wiretap(// <1>
true).connectNow(Duration.ofSeconds(30));
connection.onDispose().block();
}
Aggregations