mirror of https://github.com/apache/activemq.git
Handle continuation frames on the test client WS transport.
This commit is contained in:
parent
88efa01e11
commit
0eb11bf0a1
|
@ -34,6 +34,7 @@ import io.netty.handler.codec.http.HttpClientCodec;
|
||||||
import io.netty.handler.codec.http.HttpObjectAggregator;
|
import io.netty.handler.codec.http.HttpObjectAggregator;
|
||||||
import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
|
||||||
import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame;
|
||||||
|
import io.netty.handler.codec.http.websocketx.ContinuationWebSocketFrame;
|
||||||
import io.netty.handler.codec.http.websocketx.PingWebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.PingWebSocketFrame;
|
||||||
import io.netty.handler.codec.http.websocketx.PongWebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.PongWebSocketFrame;
|
||||||
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
|
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
|
||||||
|
@ -155,6 +156,10 @@ public class NettyWSTransport extends NettyTcpTransport {
|
||||||
BinaryWebSocketFrame binaryFrame = (BinaryWebSocketFrame) frame;
|
BinaryWebSocketFrame binaryFrame = (BinaryWebSocketFrame) frame;
|
||||||
LOG.trace("WebSocket Client received data: {} bytes", binaryFrame.content().readableBytes());
|
LOG.trace("WebSocket Client received data: {} bytes", binaryFrame.content().readableBytes());
|
||||||
listener.onData(binaryFrame.content());
|
listener.onData(binaryFrame.content());
|
||||||
|
} else if (frame instanceof ContinuationWebSocketFrame) {
|
||||||
|
ContinuationWebSocketFrame binaryFrame = (ContinuationWebSocketFrame) frame;
|
||||||
|
LOG.trace("WebSocket Client received data continuation: {} bytes", binaryFrame.content().readableBytes());
|
||||||
|
listener.onData(binaryFrame.content());
|
||||||
} else if (frame instanceof PingWebSocketFrame) {
|
} else if (frame instanceof PingWebSocketFrame) {
|
||||||
LOG.trace("WebSocket Client received ping, response with pong");
|
LOG.trace("WebSocket Client received ping, response with pong");
|
||||||
ch.write(new PongWebSocketFrame(frame.content()));
|
ch.write(new PongWebSocketFrame(frame.content()));
|
||||||
|
|
Loading…
Reference in New Issue