[
https://issues.apache.org/jira/browse/MRESOLVER-499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821457#comment-17821457
]
ASF GitHub Bot commented on MRESOLVER-499:
------------------------------------------
gnodet commented on code in PR #435:
URL: https://github.com/apache/maven-resolver/pull/435#discussion_r1505151672
##########
maven-resolver-named-locks-ipc/src/main/java/org/eclipse/aether/named/ipc/SocketFamily.java:
##########
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.aether.named.ipc;
+
+import java.io.IOException;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.UnknownHostException;
+import java.nio.channels.ServerSocketChannel;
+
+/**
+ * Socket factory.
+ *
+ * @since 2.0.0
+ */
+public enum SocketFamily {
+ inet;
+
+ public ServerSocketChannel openServerSocket() throws IOException {
+ switch (this) {
+ case inet:
+ return ServerSocketChannel.open().bind(new
InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
+ default:
+ throw new IllegalStateException();
+ }
+ }
+
+ public static SocketAddress fromString(String str) {
+ if (str.startsWith("inet:")) {
Review Comment:
Maybe adding the UDS support and the unit test would help:
https://github.com/apache/maven-mvnd/blob/0.7.1/common/src/test/java/org/mvndaemon/mvnd/common/SocketFamilyTest.java
> IPC Named Locks
> ---------------
>
> Key: MRESOLVER-499
> URL: https://issues.apache.org/jira/browse/MRESOLVER-499
> Project: Maven Resolver
> Issue Type: New Feature
> Components: Resolver
> Reporter: Tamas Cservenak
> Assignee: Tamas Cservenak
> Priority: Major
> Fix For: 2.0.0, 2.0.0-alpha-9
>
>
> Create IPC named locks implementation. Depends on MRESOLVER-421.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)