Answers for "webflux tcp client examples"

0

webflux tcp client examples

import reactor.core.publisher.Mono;
import reactor.netty.Connection;
import reactor.netty.tcp.TcpClient;

public class Application {

    public static void main(String[] args) {
        Connection connection =
                TcpClient.create()
                         .host("example.com")
                         .port(80)
                         .handle((inbound, outbound) -> outbound.sendString(Mono.just("hello"))) (1)
                         .connectNow();

        connection.onDispose()
                  .block();
    }
}
Posted by: Guest on May-24-2020
0

webflux tcp client examples

import reactor.netty.Connection;
import reactor.netty.tcp.TcpClient;

public class Application {

    public static void main(String[] args) {
        Connection connection =
                TcpClient.create()
                         .host("example.com")
                         .port(80)
                         .handle((inbound, outbound) -> inbound.receive().then()) (1)
                         .connectNow();

        connection.onDispose()
                  .block();
    }
}
Posted by: Guest on May-24-2020
0

webflux tcp client examples

import reactor.netty.Connection;
import reactor.netty.tcp.TcpClient;

public class Application {

    public static void main(String[] args) {
        Connection connection =
                TcpClient.create()
                         .host("example.com") (1)
                         .port(80)            (2)
                         .connectNow();

        connection.onDispose()
                  .block();
    }
}
Posted by: Guest on May-24-2020

Code answers related to "webflux tcp client examples"

Browse Popular Code Answers by Language