Skip to content

Commit

Permalink
Update the reference documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Nov 4, 2024
1 parent 1cb7daf commit 4352dda
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 12 deletions.
5 changes: 3 additions & 2 deletions docs/modules/ROOT/pages/http-client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions docs/modules/ROOT/pages/http-server.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions docs/modules/ROOT/pages/tcp-client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions docs/modules/ROOT/pages/tcp-server.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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("/")
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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()
Expand Down

0 comments on commit 4352dda

Please sign in to comment.