fixed tsdb test

This commit is contained in:
agapple
2017-10-14 00:12:43 +08:00
parent 19707f92d4
commit 4f00f5ea8d
55 changed files with 1002 additions and 742 deletions

View File

@@ -35,21 +35,24 @@ public class SocketChannel {
}
public void writeChannel(byte[]... buf) throws IOException {
if (channel != null && channel.isWritable()) channel.writeAndFlush(Unpooled.copiedBuffer(buf));
else throw new IOException("write failed ! please checking !");
if (channel != null && channel.isWritable()) {
channel.writeAndFlush(Unpooled.copiedBuffer(buf));
} else {
throw new IOException("write failed ! please checking !");
}
}
public byte[] read(int readSize) throws IOException {
do {
if (readSize > cache.readableBytes()) {
if (null == channel) {
throw new IOException("socket has Interrupted !");
throw new java.nio.channels.ClosedByInterruptException();
}
synchronized (this) {
try {
wait(100);
} catch (InterruptedException e) {
throw new IOException("socket has Interrupted !");
throw new java.nio.channels.ClosedByInterruptException();
}
}
} else {