Skip to content

Commit d208c8a

Browse files
committed
check that at least one endpoint is TCP for cluster
1 parent 17dcf82 commit d208c8a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

libs/cluster/Server/ClusterManager.cs

+12-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,18 @@ public unsafe ClusterManager(ClusterProvider clusterProvider, ILogger logger = n
5050
clusterConfigDevice = deviceFactory.Get(new FileDescriptor(directoryName: "", fileName: "nodes.conf"));
5151
pool = new(1, (int)clusterConfigDevice.SectorSize);
5252

53-
if (opts.EndPoints[0] is not IPEndPoint endpoint)
54-
throw new NotImplementedException("Cluster mode for unix domain sockets has not been implemented.");
53+
IPEndPoint endpoint = null;
54+
foreach (var endPoint in opts.EndPoints)
55+
{
56+
if (endPoint is IPEndPoint _endpoint)
57+
{
58+
endpoint = _endpoint;
59+
break;
60+
}
61+
}
62+
63+
if (endpoint == null)
64+
throw new GarnetException("No valid IPEndPoint found in endPoint list");
5565

5666
var address = clusterProvider.storeWrapper.GetIp();
5767

0 commit comments

Comments
 (0)