use of reactor.netty.Connection in project reactor-netty by reactor.
the class Application method main.
public static void main(String[] args) {
Connection server = UdpServer.create().metrics(// <1>
true).bindNow(Duration.ofSeconds(30));
server.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 server = UdpServer.create().handle((in, out) -> out.sendObject(in.receiveObject().map(o -> {
if (o instanceof DatagramPacket) {
DatagramPacket p = (DatagramPacket) o;
// <1>
return new DatagramPacket(p.content().retain(), p.sender());
} else {
return Mono.error(new Exception("Unexpected type of the message: " + o));
}
}))).bindNow(Duration.ofSeconds(30));
server.onDispose().block();
}
use of reactor.netty.Connection in project reactor-netty by reactor.
the class Application method main.
public static void main(String[] args) {
LoopResources loop = LoopResources.create("event-loop", 1, 4, true);
Connection connection = TcpClient.create().host("example.com").port(80).runOn(loop).connectNow();
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 = TcpClient.create().host("example.com").port(80).metrics(// <1>
true).connectNow();
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 = TcpClient.newConnection().host("example.com").port(80).connectNow();
connection.onDispose().block();
}
Aggregations