diff --git a/src/main/java/envoy/server/data/User.java b/src/main/java/envoy/server/data/User.java
index 5cb4b9e..877a699 100644
--- a/src/main/java/envoy/server/data/User.java
+++ b/src/main/java/envoy/server/data/User.java
@@ -86,7 +86,7 @@ public class User {
public String getName() { return name; }
/**
- * @param name the user name to set
+ * @param name the username to set
* @since Envoy Server Standalone v0.1-alpha
* @see User#getName()
*/
diff --git a/src/main/java/envoy/server/net/ObjectMessageReader.java b/src/main/java/envoy/server/net/ObjectMessageReader.java
index 1206cd6..1ae8e9a 100644
--- a/src/main/java/envoy/server/net/ObjectMessageReader.java
+++ b/src/main/java/envoy/server/net/ObjectMessageReader.java
@@ -5,10 +5,7 @@ import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
-import com.jenkov.nioserver.IMessageReader;
-import com.jenkov.nioserver.Message;
-import com.jenkov.nioserver.MessageBuffer;
-import com.jenkov.nioserver.Socket;
+import com.jenkov.nioserver.*;
import envoy.util.SerializationUtils;
@@ -48,18 +45,26 @@ public class ObjectMessageReader implements IMessageReader {
}
nextMessage.writeToMessage(buffer);
+ buffer.clear();
// Get message length
if (nextMessage.length < 4) return;
int length = SerializationUtils.bytesToInt(nextMessage.sharedArray, nextMessage.offset) + 4;
+ do {
- if (nextMessage.length >= length) {
- Message message = messageBuffer.getMessage();
- message.writePartialMessageToMessage(nextMessage, nextMessage.offset + length);
- completeMessages.add(nextMessage);
- nextMessage = message;
- }
+ // Separate first complete message
+ if (nextMessage.length >= length) {
+ Message message = messageBuffer.getMessage();
+ message.writePartialMessageToMessage(nextMessage, nextMessage.offset + length);
+ message.length = nextMessage.length - length;
+ completeMessages.add(nextMessage);
+ nextMessage = message;
+ }
- buffer.clear();
+ // Get message length
+ if (nextMessage.length < 4) return;
+ length = SerializationUtils.bytesToInt(nextMessage.sharedArray, nextMessage.offset) + 4;
+
+ } while (nextMessage.length >= length);
}
}
\ No newline at end of file
diff --git a/src/main/java/envoy/server/processors/IdGeneratorRequestProcessor.java b/src/main/java/envoy/server/processors/IdGeneratorRequestProcessor.java
index 31ba1c0..e12fbd2 100644
--- a/src/main/java/envoy/server/processors/IdGeneratorRequestProcessor.java
+++ b/src/main/java/envoy/server/processors/IdGeneratorRequestProcessor.java
@@ -14,7 +14,7 @@ import envoy.server.net.ObjectWriteProxy;
* File: IdGeneratorRequestProcessor.java
* Created: 28 Jan 2020
*
- * @author KSKE
+ * @author Kai S. K. Engelbart
* @since Envoy Server Standalone v0.1-alpha
*/
public class IdGeneratorRequestProcessor implements ObjectProcessor {