赵延 created ZOOKEEPER-4182:
-----------------------------

             Summary:  Enhance message when packet's length over limit.
                 Key: ZOOKEEPER-4182
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4182
             Project: ZooKeeper
          Issue Type: Improvement
          Components: java client
    Affects Versions: 3.6.2
            Reporter: 赵延


{code:java}
void readLength() throws IOException {
    int len = incomingBuffer.getInt();
    if (len < 0 || len >= packetLen) {
        throw new IOException("Packet len " + len + " is out of range!");
    }
    incomingBuffer = ByteBuffer.allocate(len);
}
{code}
 

The message can append `packetLen` info.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to