This commit is contained in:
地平线
2015-08-27 17:01:22 +08:00
parent c4e63cb7d4
commit 26f77cacb3
2 changed files with 2 additions and 8 deletions

View File

@@ -162,7 +162,7 @@ public final class Transport {
}
public void offerConnection(AsyncConnection conn) {
if (conn.isTCP()) {
if (conn.isTCP() && false) { //暂时每次都关闭
if (conn.isOpen()) {
BlockingQueue<AsyncConnection> queue = connPool.get(conn.getRemoteAddress());
if (queue == null) {

View File

@@ -285,13 +285,7 @@ public final class SncpClient {
conn.read(buffer).get(readto > 0 ? readto : 5, TimeUnit.SECONDS);
buffer.flip();
long rseqid = buffer.getLong();
while (rseqid != seqid) {
if (!conn.isTCP()) throw new RuntimeException("sncp send seqid = " + seqid + ", but receive seqid =" + rseqid);
buffer.clear();
conn.read(buffer).get(readto > 0 ? readto : 5, TimeUnit.SECONDS);
buffer.flip();
rseqid = buffer.getLong();
}
if (rseqid != seqid) throw new RuntimeException("sncp send seqid = " + seqid + ", but receive seqid =" + rseqid);
if (buffer.getChar() != HEADER_SIZE) throw new RuntimeException("sncp buffer receive header.length not " + HEADER_SIZE);
long rserviceid = buffer.getLong();
if (rserviceid != serviceid) throw new RuntimeException("sncp send serviceid = " + serviceid + ", but receive serviceid =" + rserviceid);