This commit is contained in:
Redkale
2018-05-07 11:46:05 +08:00
parent 20940e82de
commit 0bf34781c5
2 changed files with 2 additions and 2 deletions

View File

@@ -256,7 +256,7 @@ class WebSocketRunner implements Runnable {
break; break;
} }
} }
if (index >= 0) { if (index >= 0) { //ByteBuffer[]统一回收的可以采用此写法
channel.write(attachments, index, attachments.length - index, attachments, this); channel.write(attachments, index, attachments.length - index, attachments, this);
return; return;
} }

View File

@@ -377,7 +377,7 @@ public final class SncpClient {
transport.offerBuffer(attachments[i]); transport.offerBuffer(attachments[i]);
} }
} }
if (index == 0) { if (index == 0) { //ByteBuffer[]不统一回收的必须采用此写法分开
conn.write(attachments, attachments, this); conn.write(attachments, attachments, this);
return; return;
} else if (index > 0) { } else if (index > 0) {