-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Hi, I have some questions about the code.
First, in AbstractPacketWorker#addData
:
I notice that you use a tempArray
to copy the array, would it be better to copy between bytebuffers directly? Like this:
data.flip();
// Make a copy of the data
buffer.put(data);
Besides, in this method, this.pendingData.remove(socket);
should be able to be removed.
Second, in VariableLengthPacketWorker#prepareForWait
, It looks like there's some duplication of work, I used the following code , it seems work well as well.
data.position(data.limit());
data.limit(data.capacity());
pendingSockets.removeFirst();
Looking forward to your reply, and thank you very much for your good code and comments~~~
Metadata
Metadata
Assignees
Labels
No labels