Fix client connection

This commit is contained in:
Andrea Cavalli 2024-10-04 01:16:47 +02:00
parent 310f94d473
commit 47c3e31f75

View File

@ -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 _) {