forked from KNEMC/KLALB
UI改进
This commit is contained in:
@@ -20,6 +20,15 @@ public class SocketToSocketProxy extends Proxy {
|
||||
private SocketBridgeFactory defaultFactory;
|
||||
private SocketChannelBridgeFactory defaultChannelFactory;
|
||||
private Map<String, SocketBridgeFactory> detectedFactory;
|
||||
private int defaultSoTimeout=120*60*1000;
|
||||
|
||||
public int getDefaultSoTimeout() {
|
||||
return defaultSoTimeout;
|
||||
}
|
||||
|
||||
public void setDefaultSoTimeout(int defaultSoTimeout) {
|
||||
this.defaultSoTimeout = defaultSoTimeout;
|
||||
}
|
||||
|
||||
public SocketToSocketProxy(MultipurposeSocketAddress listen, MultipurposeSocketAddress connect) throws IOException {
|
||||
this(listen, new MultipurposeSocketAddress(new InetSocketAddress(0)), connect);
|
||||
@@ -152,6 +161,8 @@ public class SocketToSocketProxy extends Proxy {
|
||||
|
||||
protected void runBridge(SocketBridgeFactory sbf,Socket sk, Socket sox) throws IOException {
|
||||
|
||||
sk.setSoTimeout(defaultSoTimeout);
|
||||
sox.setSoTimeout(defaultSoTimeout);
|
||||
sk.setTcpNoDelay(true);
|
||||
sox.setTcpNoDelay(true);
|
||||
SocketBridge sb = sbf.createBridge(sk, sox);
|
||||
@@ -159,6 +170,8 @@ public class SocketToSocketProxy extends Proxy {
|
||||
}
|
||||
|
||||
protected void runChannelBridge(SocketChannelBridgeFactory sbf,SocketChannel sk, SocketChannel sox) throws IOException {
|
||||
//sk.setSoTimeout(defaultSoTimeout);
|
||||
//sox.setSoTimeout(defaultSoTimeout);
|
||||
sk.setOption(StandardSocketOptions.TCP_NODELAY, true);
|
||||
sox.setOption(StandardSocketOptions.TCP_NODELAY, true);
|
||||
SocketChannelBridge sb = sbf.createBridge(sk, sox);
|
||||
|
||||
Reference in New Issue
Block a user