feature: fail over from index

This commit is contained in:
tanyawen01770
2023-01-28 19:53:06 +08:00
parent 77946b2382
commit 0087216c0a
6 changed files with 50 additions and 55 deletions

View File

@@ -25,11 +25,18 @@ import java.net.InetSocketAddress;
public class TrackerServer {
protected InetSocketAddress inetSockAddr;
protected int index;
public TrackerServer(InetSocketAddress inetSockAddr) throws IOException {
this.inetSockAddr = inetSockAddr;
}
public TrackerServer(InetSocketAddress inetSockAddr, int index) {
this.inetSockAddr = inetSockAddr;
this.index = index;
}
public Connection getConnection() throws MyException, IOException {
Connection connection;
if (ClientGlobal.g_connection_pool_enabled) {
@@ -48,4 +55,11 @@ public class TrackerServer {
return this.inetSockAddr;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
}