Search in sources :

Example 6 with Connection

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 = UdpClient.create().host("example.com").port(80).runOn(loop).connectNow(Duration.ofSeconds(30));
    connection.onDispose().block();
}
Also used : LoopResources(reactor.netty.resources.LoopResources) Connection(reactor.netty.Connection)

Example 7 with Connection

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(// <1>
    true).connectNow(Duration.ofSeconds(30));
    connection.onDispose().block();
}
Also used : Connection(reactor.netty.Connection)

Example 8 with Connection

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().remoteAddress(// <1>
    () -> new DomainSocketAddress("/tmp/test.sock")).connectNow();
    connection.onDispose().block();
}
Also used : Connection(reactor.netty.Connection) DomainSocketAddress(io.netty.channel.unix.DomainSocketAddress)

Example 9 with Connection

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(// <1>
    "example.com").port(// <2>
    80).connectNow();
    connection.onDispose().block();
}
Also used : Connection(reactor.netty.Connection)

Example 10 with Connection

use of reactor.netty.Connection in project reactor-netty by reactor.

the class Application method main.

public static void main(String[] args) {
    Connection connection = // <1>
    TcpClient.create().connectNow();
    connection.onDispose().block();
}
Also used : Connection(reactor.netty.Connection)

Aggregations

Connection (reactor.netty.Connection)137 Test (org.junit.jupiter.api.Test)69 CountDownLatch (java.util.concurrent.CountDownLatch)52 Duration (java.time.Duration)49 Mono (reactor.core.publisher.Mono)47 InetSocketAddress (java.net.InetSocketAddress)41 TimeUnit (java.util.concurrent.TimeUnit)39 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)38 LoopResources (reactor.netty.resources.LoopResources)38 ByteBuf (io.netty.buffer.ByteBuf)35 Flux (reactor.core.publisher.Flux)35 DisposableServer (reactor.netty.DisposableServer)35 DomainSocketAddress (io.netty.channel.unix.DomainSocketAddress)33 AtomicReference (java.util.concurrent.atomic.AtomicReference)32 List (java.util.List)31 IOException (java.io.IOException)30 Assertions.assertThatExceptionOfType (org.assertj.core.api.Assertions.assertThatExceptionOfType)30 ChannelOption (io.netty.channel.ChannelOption)29 Unpooled (io.netty.buffer.Unpooled)28 Charset (java.nio.charset.Charset)28