I have scenario similar to the unit test case TestReceiveInLength() in the SocketServerTest.cs class. Client sends length of data in the command and
then it immediately sends actual data. I am using following code in the ExecuteCommand method of my custom command.
int dataLength = GetDataLengthByParsingCommand(); // Here I parse the command and determine length of data
MemoryStream ms = new MemoryStream();
session.SocketSession.ReceiveData(ms, dataLength); // This call never returns
byte  data = ms.ToArray();
But the ReceiveData() methods does not read anything and it goes into infinite loop. If I add delay of 100ms in the client code between sending command and actual (like what you
did in TestReceiveInLength() test case), then it works correctly. But the problem is that I do not control client commands and cannot insert required delay.
Is this a limitation in the SuperSocket library? Any workaround in server code as I cannot modify client?