From 47c3e31f75464e83c3d238d1afac3b4ce559cc83 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Fri, 4 Oct 2024 01:16:47 +0200 Subject: [PATCH] Fix client connection --- .../rockserver/core/client/GrpcConnection.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/it/cavallium/rockserver/core/client/GrpcConnection.java b/src/main/java/it/cavallium/rockserver/core/client/GrpcConnection.java index 1a684d4..7a1c0bd 100644 --- a/src/main/java/it/cavallium/rockserver/core/client/GrpcConnection.java +++ b/src/main/java/it/cavallium/rockserver/core/client/GrpcConnection.java @@ -75,8 +75,16 @@ public class GrpcConnection extends BaseConnection implements RocksDBAPI { private GrpcConnection(String name, SocketAddress socketAddress, URI address) { super(name); - var channelBuilder = NettyChannelBuilder - .forAddress(socketAddress) + NettyChannelBuilder channelBuilder; + if (socketAddress instanceof InetSocketAddress inetSocketAddress) { + channelBuilder = NettyChannelBuilder + .forAddress(inetSocketAddress.getHostString(), inetSocketAddress.getPort()); + } else { + channelBuilder = NettyChannelBuilder + .forAddress(socketAddress); + } + + channelBuilder .directExecutor() .usePlaintext(); if (socketAddress instanceof DomainSocketAddress _) {