优化代码,性能暴涨
This commit is contained in:
@@ -6,6 +6,7 @@ import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.net.Inet6Address;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketException;
|
||||
import java.net.SocketTimeoutException;
|
||||
@@ -19,6 +20,7 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.kne.cloud.network.*;
|
||||
import org.kne.cloud.network.klalb.ui.KLALBStateGUI2;
|
||||
import org.kne.cloud.network.minecraft.MinecraftSocketBridge;
|
||||
|
||||
import java.util.Set;
|
||||
@@ -109,6 +111,7 @@ public class KLALBProxySystem {
|
||||
switch (entry.get("Type").getAsString()) {
|
||||
case "KLALBController":
|
||||
JsonElement vase= entry.get("VirtualAddress");
|
||||
//System.out.println(vase);
|
||||
if(vase!=null) {
|
||||
try {
|
||||
klalbController=new KLALBController((Inet6Address) InetAddress.getByName(vase.getAsString()));
|
||||
@@ -141,7 +144,8 @@ public class KLALBProxySystem {
|
||||
}
|
||||
|
||||
});
|
||||
klalbController.getListenSocketAddress().add(mpsa);
|
||||
MultipurposeSocketAddress mpsa2=new MultipurposeSocketAddress(mpsa.getType(), mpsa.getHost(),((InetSocketAddress)tcpl.getServerSocketChannel().getLocalAddress()).getPort());
|
||||
klalbController.getListenSocketAddress().add(mpsa2);
|
||||
} catch (IOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
@@ -164,7 +168,8 @@ public class KLALBProxySystem {
|
||||
}
|
||||
|
||||
});
|
||||
//klalbController.getListenSocketAddress().add(mpsa);
|
||||
MultipurposeSocketAddress mpsau2=new MultipurposeSocketAddress(mpsa.getType(), mpsa.getHost(),((InetSocketAddress)(udpl.getDatagramServerSocket().getLocalSocketAddress())).getPort());
|
||||
//klalbController.getListenSocketAddress().add(mpsau2);
|
||||
} catch (IOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
@@ -181,13 +186,7 @@ public class KLALBProxySystem {
|
||||
if(linetoc!=null) {
|
||||
JsonArray jary=(JsonArray)linetoc;
|
||||
jary.forEach((aline)->{
|
||||
try {
|
||||
klalbController.addRemoteLines(new MultipurposeSocketAddress(aline.getAsString()));
|
||||
} catch (SocketTimeoutException e) {
|
||||
e.printStackTrace();
|
||||
} catch (SocketException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
klalbController.addRemoteLines(new MultipurposeSocketAddress(aline.getAsString()));
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user