Closed sanjay-saxena closed 9 years ago
Are the scripts under ws/src/test/scripts
still needed by anything?
ws/src/test/scripts
contains scripts for extension related tests and other tests that try to simulate metadata bytes split across different chunks.
If we had randomized fragmentation support in k3po would those split bytes tests still be needed?
What is being tested in the extension scripts that is not already covered by the specification scripts?
The FIN
bit feedback above doesn't seem to be addressed yet.
If we have randomized fragmentation support in k3po, then we can get rid of the split bytes test from netx. The extension tests simulate removing a certain prefix from the outgoing frame and then adding a certain prefix for incoming frame.
Here is the FIN feedback from above:
FIN bit should be set on close(), not flush(), right?
I have implemented this in the OutputStream and Reader implementations that are embedded in WsMessageWriter. Here is the close() method in embedded OutputStream implementation that is within WsMessageWriter:
@Override
public void close() throws IOException {
try {
lock.lock();
if (initialFrame) {
// Only one frame in the message.
connection.getOutputStream().write(binaryBuffer, 0, binaryBufferOffset);
}
else {
// Send the final frame.
connection.getOutputStream().writeBinary(CONTINUATION, binaryBuffer, 0, binaryBufferOffset, true);
}
initialFrame = true;
binaryBufferOffset = 0;
}
finally {
lock.unlock();
}
}
Excellent work @sanjay-saxena. 😎
to support messages that fit in a single WebSocket frame and messages that span across multiple WebSocket frames.