This commit is contained in:
地平线
2015-09-04 09:52:09 +08:00
parent 4419629c71
commit 1869070040

View File

@@ -174,7 +174,8 @@ public final class SncpClient {
DLong actionid = Sncp.hash(method); DLong actionid = Sncp.hash(method);
Method old = actionids.get(actionid); Method old = actionids.get(actionid);
if (old != null) { if (old != null) {
if (old.getDeclaringClass().equals(method.getDeclaringClass())) throw new RuntimeException(serviceClass.getName() + " have one more same action(Method=" + method + ", actionid=" + actionid + ")"); if (old.getDeclaringClass().equals(method.getDeclaringClass()))
throw new RuntimeException(serviceClass.getName() + " have one more same action(Method=" + method + ", actionid=" + actionid + ")");
continue; continue;
} }
actionids.put(actionid, method); actionids.put(actionid, method);
@@ -325,10 +326,14 @@ public final class SncpClient {
if (rnameid != nameid) throw new RuntimeException("sncp send nameid = " + nameid + ", but receive next.nameid =" + rnameid); if (rnameid != nameid) throw new RuntimeException("sncp send nameid = " + nameid + ", but receive next.nameid =" + rnameid);
ractionid1 = buffer.getLong(); ractionid1 = buffer.getLong();
ractionid2 = buffer.getLong(); ractionid2 = buffer.getLong();
if (!actionid.compare(ractionid1, ractionid2)) throw new RuntimeException("sncp send actionid = " + actionid + ", but receive next.actionid =(" + ractionid1 + "_" + ractionid2 + ")"); if (!actionid.compare(ractionid1, ractionid2))
throw new RuntimeException("sncp send actionid = " + actionid + ", but receive next.actionid =(" + ractionid1 + "_" + ractionid2 + ")");
buffer.getInt();
buffer.getInt();
if (buffer.get() < 1) throw new RuntimeException("sncp send nameid = " + nameid + ", but next.frame.count != " + frameCount); if (buffer.get() < 1) throw new RuntimeException("sncp send nameid = " + nameid + ", but next.frame.count != " + frameCount);
frameIndex = buffer.get(); frameIndex = buffer.get();
if (frameIndex < 0 || frameIndex >= frameCount) throw new RuntimeException("sncp receive nameid = " + nameid + ", but frame.count =" + frameCount + " & next.frame.index =" + frameIndex); if (frameIndex < 0 || frameIndex >= frameCount)
throw new RuntimeException("sncp receive nameid = " + nameid + ", but frame.count =" + frameCount + " & next.frame.index =" + frameIndex);
int rretcode = buffer.getInt(); int rretcode = buffer.getInt();
if (rretcode != 0) throw new RuntimeException("remote service deal error (receive retcode =" + rretcode + ")"); if (rretcode != 0) throw new RuntimeException("remote service deal error (receive retcode =" + rretcode + ")");
int rbodylen = buffer.getInt(); int rbodylen = buffer.getInt();