fixed issue #726 , 优化完毕

This commit is contained in:
七锋
2018-07-20 14:32:13 +08:00
parent b4c6490c94
commit fe38bc16d2
4 changed files with 48 additions and 54 deletions

View File

@@ -1,5 +1,6 @@
package com.alibaba.otter.canal.parse.driver.mysql.socket;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -24,7 +25,7 @@ public class BioSocketChannel implements SocketChannel {
BioSocketChannel(Socket socket) throws IOException{
this.socket = socket;
this.input = socket.getInputStream();
this.input = new BufferedInputStream(socket.getInputStream(), 16384);
this.output = socket.getOutputStream();
}
@@ -164,5 +165,4 @@ public class BioSocketChannel implements SocketChannel {
this.socket = null;
}
}

View File

@@ -16,6 +16,8 @@ public abstract class BioSocketChannelPool {
socket.setKeepAlive(true);
socket.setReuseAddress(true);
socket.connect(address, BioSocketChannel.DEFAULT_CONNECT_TIMEOUT);
System.out.println(socket.getReceiveBufferSize());
System.out.println(socket.getSendBufferSize());
return new BioSocketChannel(socket);
}