This commit is contained in:
@@ -162,7 +162,7 @@ public final class Transport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void offerConnection(AsyncConnection conn) {
|
public void offerConnection(AsyncConnection conn) {
|
||||||
if (conn.isTCP()) {
|
if (conn.isTCP() && false) { //暂时每次都关闭
|
||||||
if (conn.isOpen()) {
|
if (conn.isOpen()) {
|
||||||
BlockingQueue<AsyncConnection> queue = connPool.get(conn.getRemoteAddress());
|
BlockingQueue<AsyncConnection> queue = connPool.get(conn.getRemoteAddress());
|
||||||
if (queue == null) {
|
if (queue == null) {
|
||||||
|
|||||||
@@ -285,13 +285,7 @@ public final class SncpClient {
|
|||||||
conn.read(buffer).get(readto > 0 ? readto : 5, TimeUnit.SECONDS);
|
conn.read(buffer).get(readto > 0 ? readto : 5, TimeUnit.SECONDS);
|
||||||
buffer.flip();
|
buffer.flip();
|
||||||
long rseqid = buffer.getLong();
|
long rseqid = buffer.getLong();
|
||||||
while (rseqid != seqid) {
|
if (rseqid != seqid) throw new RuntimeException("sncp send seqid = " + seqid + ", but receive seqid =" + rseqid);
|
||||||
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 (buffer.getChar() != HEADER_SIZE) throw new RuntimeException("sncp buffer receive header.length not " + HEADER_SIZE);
|
if (buffer.getChar() != HEADER_SIZE) throw new RuntimeException("sncp buffer receive header.length not " + HEADER_SIZE);
|
||||||
long rserviceid = buffer.getLong();
|
long rserviceid = buffer.getLong();
|
||||||
if (rserviceid != serviceid) throw new RuntimeException("sncp send serviceid = " + serviceid + ", but receive serviceid =" + rserviceid);
|
if (rserviceid != serviceid) throw new RuntimeException("sncp send serviceid = " + serviceid + ", but receive serviceid =" + rserviceid);
|
||||||
|
|||||||
Reference in New Issue
Block a user