ConnectionPool.getKey() use '-' instead of ':'

This commit is contained in:
YuQing
2025-12-18 10:39:33 +08:00
parent 91a5cc2e36
commit d29ca63106
6 changed files with 8 additions and 5 deletions
+3
View File
@@ -1,4 +1,7 @@
Version 1.39 2025-12-18
* ConnectionPool.getKey() use '-' instead of ':'
Version 1.38 2025-11-28
* bugfixed: loadStorageServersFromTracker correctly with rw option
* throw IOException with msg "connection broken" when in.read() < 0
+1 -1
View File
@@ -4,7 +4,7 @@
<target name="init">
<property name="project.name" value="fastdfs-client-java"/>
<property name="project.version" value="1.27-SNAPSHOT"/>
<property name="project.version" value="1.38-SNAPSHOT"/>
<property name="project.java" value="${basedir}/src/main/java"/>
<property name="project.resources" value="${basedir}/src/main/resources"/>
<property name="project.build" value="${basedir}/build"/>
@@ -97,6 +97,7 @@ public class Connection {
}
return isConnected;
}
public boolean isAvaliable() {
if (isConnected()) {
if (sock.getPort() == 0) {
@@ -23,7 +23,8 @@ public class ConnectionFactory {
sock.connect(socketAddress, ClientGlobal.g_connect_timeout);
return new Connection(sock, socketAddress);
} catch (Exception e) {
throw new MyException("connect to server " + socketAddress.getAddress().getHostAddress() + ":" + socketAddress.getPort() + " fail, emsg: " + e.getMessage());
throw new MyException("connect to server " + socketAddress.getAddress().getHostAddress()
+ ":" + socketAddress.getPort() + " fail, emsg: " + e.getMessage());
}
}
}
@@ -115,7 +115,6 @@ public class ConnectionManager {
} finally {
lock.unlock();
}
}
public void closeConnection(Connection connection) {
@@ -43,7 +43,6 @@ public class ConnectionPool {
} else {
connection.closeDirectly();
}
}
public static void closeConnection(Connection connection) throws IOException {
@@ -64,7 +63,7 @@ public class ConnectionPool {
if (socketAddress == null) {
return null;
}
return String.format("%s:%s", socketAddress.getAddress().getHostAddress(), socketAddress.getPort());
return String.format("%s-%s", socketAddress.getAddress().getHostAddress(), socketAddress.getPort());
}
@Override