This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user