mirror of
https://github.com/happyfish100/fastdfs-client-java.git
synced 2026-09-25 08:19:02 +00:00
ConnectionPool.getKey() use '-' instead of ':'
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user