Skip to content

Commit 9339e80

Browse files
committed
Explicitly set socket timeout.
1 parent debdb3c commit 9339e80

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

java-components/domain-proxy/client/src/main/java/com/redhat/hacbs/domainproxy/client/DomainProxyClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public void start() {
4646
try (final ServerSocket serverSocket = new ServerSocket(clientHttpPort)) {
4747
while (running) {
4848
final Socket socket = serverSocket.accept();
49+
socket.setSoTimeout(1200000);
4950
final UnixDomainSocketAddress address = UnixDomainSocketAddress.of(domainSocket);
5051
final SocketChannel channel = SocketChannel.open(address);
5152
// Write from socket to channel

java-components/domain-proxy/server/src/main/java/com/redhat/hacbs/domainproxy/DomainProxyServer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public void start() {
6060
while (running) {
6161
final SocketChannel channel = serverChannel.accept();
6262
final Socket socket = new Socket(LOCALHOST, httpServerPort);
63+
socket.setSoTimeout(1200000);
6364
// Write from socket to channel
6465
Thread.startVirtualThread(createSocketToChannelWriter(byteBufferSize, socket, channel));
6566
// Write from channel to socket

0 commit comments

Comments
 (0)