diff --git a/docs/modules/ROOT/pages/http-client.adoc b/docs/modules/ROOT/pages/http-client.adoc index 7385d8c6c7..1d2fcc5a97 100644 --- a/docs/modules/ROOT/pages/http-client.adoc +++ b/docs/modules/ROOT/pages/http-client.adoc @@ -489,13 +489,14 @@ You may also need to configure the Reactor Netty `ObservationHandlers` using the [[unix-domain-sockets]] == Unix Domain Sockets -The `HTTP` client supports Unix Domain Sockets (UDS) when native transport is in use. +The `HTTP` client supports Unix Domain Sockets (UDS) when native transport is in use for all java versions +and when NIO transport is in use for java 17 and above. The following example shows how to use UDS support: {examples-link}/uds/Application.java ---- -include::{examples-dir}/uds/Application.java[lines=18..33] +include::{examples-dir}/uds/Application.java[lines=18..38] ---- <1> Specifies `DomainSocketAddress` that will be used diff --git a/docs/modules/ROOT/pages/http-server.adoc b/docs/modules/ROOT/pages/http-server.adoc index fc74ad4ce1..b0ec1e7c8a 100644 --- a/docs/modules/ROOT/pages/http-server.adoc +++ b/docs/modules/ROOT/pages/http-server.adoc @@ -646,13 +646,14 @@ You may also need to configure the Reactor Netty `ObservationHandlers` using the [[unix-domain-sockets]] == Unix Domain Sockets -The `HTTP` server supports Unix Domain Sockets (UDS) when native transport is in use. +The `HTTP` server supports Unix Domain Sockets (UDS) when native transport is in use for all java versions +and when NIO transport is in use for java 17 and above. The following example shows how to use UDS support: {examples-link}/uds/Application.java ---- -include::{examples-dir}/uds/Application.java[lines=18..33] +include::{examples-dir}/uds/Application.java[lines=18..38] ---- <1> Specifies `DomainSocketAddress` that will be used diff --git a/docs/modules/ROOT/pages/tcp-client.adoc b/docs/modules/ROOT/pages/tcp-client.adoc index 66e8a2118e..9f567c2e2d 100644 --- a/docs/modules/ROOT/pages/tcp-client.adoc +++ b/docs/modules/ROOT/pages/tcp-client.adoc @@ -336,14 +336,15 @@ You may also need to configure the Reactor Netty `ObservationHandlers` using the [[unix-domain-sockets]] == Unix Domain Sockets -The `TCP` client supports Unix Domain Sockets (UDS) when native transport is in use. +The `TCP` client supports Unix Domain Sockets (UDS) when native transport is in use for all java versions +and when NIO transport is in use for java 17 and above. The following example shows how to use UDS support: {examples-link}/uds/Application.java [%unbreakable] ---- -include::{examples-dir}/uds/Application.java[lines=18..33] +include::{examples-dir}/uds/Application.java[lines=18..38] ---- <1> Specifies `DomainSocketAddress` that will be used diff --git a/docs/modules/ROOT/pages/tcp-server.adoc b/docs/modules/ROOT/pages/tcp-server.adoc index a604266ddd..310e8dd9b0 100644 --- a/docs/modules/ROOT/pages/tcp-server.adoc +++ b/docs/modules/ROOT/pages/tcp-server.adoc @@ -305,13 +305,14 @@ You may also need to configure the Reactor Netty `ObservationHandlers` using the [[unix-domain-sockets]] == Unix Domain Sockets -The `TCP` server supports Unix Domain Sockets (UDS) when native transport is in use. +The `TCP` server supports Unix Domain Sockets (UDS) when native transport is in use for all java versions +and when NIO transport is in use for java 17 and above. The following example shows how to use UDS support: {examples-link}/uds/Application.java [%unbreakable] ---- -include::{examples-dir}/uds/Application.java[lines=18..33] +include::{examples-dir}/uds/Application.java[lines=18..38] ---- <1> Specifies `DomainSocketAddress` that will be used diff --git a/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/http/client/uds/Application.java b/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/http/client/uds/Application.java index 00cf9ec353..50163e636f 100644 --- a/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/http/client/uds/Application.java +++ b/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/http/client/uds/Application.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2020-2024 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,12 +18,17 @@ import io.netty.channel.unix.DomainSocketAddress; import reactor.netty.http.client.HttpClient; +//import java.net.UnixDomainSocketAddress; + public class Application { public static void main(String[] args) { HttpClient client = HttpClient.create() + // The configuration below is available only when Epoll/KQueue transport is used .remoteAddress(() -> new DomainSocketAddress("/tmp/test.sock")); //<1> + // The configuration below is available only when NIO transport is used with Java 17+ + //.remoteAddress(() -> UnixDomainSocketAddress.of("/tmp/test.sock")); client.get() .uri("/") diff --git a/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/http/server/uds/Application.java b/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/http/server/uds/Application.java index bb94c89314..d20b4a47fc 100644 --- a/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/http/server/uds/Application.java +++ b/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/http/server/uds/Application.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2020-2024 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,12 +19,17 @@ import reactor.netty.DisposableServer; import reactor.netty.http.server.HttpServer; +//import java.net.UnixDomainSocketAddress; + public class Application { public static void main(String[] args) { DisposableServer server = HttpServer.create() + // The configuration below is available only when Epoll/KQueue transport is used .bindAddress(() -> new DomainSocketAddress("/tmp/test.sock")) //<1> + // The configuration below is available only when NIO transport is used with Java 17+ + //.bindAddress(() -> UnixDomainSocketAddress.of("/tmp/test.sock")) .bindNow(); server.onDispose() diff --git a/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/tcp/client/uds/Application.java b/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/tcp/client/uds/Application.java index 68522824c0..d5ce8194cd 100644 --- a/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/tcp/client/uds/Application.java +++ b/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/tcp/client/uds/Application.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2020-2024 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,12 +19,17 @@ import reactor.netty.Connection; import reactor.netty.tcp.TcpClient; +//import java.net.UnixDomainSocketAddress; + public class Application { public static void main(String[] args) { Connection connection = TcpClient.create() + // The configuration below is available only when Epoll/KQueue transport is used .remoteAddress(() -> new DomainSocketAddress("/tmp/test.sock")) //<1> + // The configuration below is available only when NIO transport is used with Java 17+ + //.remoteAddress(() -> UnixDomainSocketAddress.of("/tmp/test.sock")) .connectNow(); connection.onDispose() diff --git a/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/tcp/server/uds/Application.java b/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/tcp/server/uds/Application.java index 2911d91198..30f821dc93 100644 --- a/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/tcp/server/uds/Application.java +++ b/reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/tcp/server/uds/Application.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2020-2024 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,12 +19,17 @@ import reactor.netty.DisposableServer; import reactor.netty.tcp.TcpServer; +//import java.net.UnixDomainSocketAddress; + public class Application { public static void main(String[] args) { DisposableServer server = TcpServer.create() + // The configuration below is available only when Epoll/KQueue transport is used .bindAddress(() -> new DomainSocketAddress("/tmp/test.sock")) //<1> + // The configuration below is available only when NIO transport is used with Java 17+ + //.bindAddress(() -> UnixDomainSocketAddress.of("/tmp/test.sock")) .bindNow(); server.onDispose()