mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
fixed issue #726 , 优化完毕
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user