我使用jetty 8.2.0,有时收到此消息,我如何扩大可接受的文本的最大尺寸?
WARN:oejw.WebSocketConnectionRFC6455:Text message too large > 16384 chars for SSL NOT_HANDSHAKING i/o/u=0/0/0 ishut=false oshut=false {WebSocketClientConnection p=WebSocketParserRFC6455@ac0d159 state=DATA buffer= g=WebSocketGeneratorRFC6455@7337dff closed=false buffer=-1}
也许我找到了一个解决方案,但我不确定,也许有人会发送更好的解决方案
String urlConnect = "wss://test.test.com:11111/websocket";
WebSocket webSocket = new WebSocket.OnTextMessage() {...};
WebSocketClientFactory webSocketClientFactory = new WebSocketClientFactory();
webSocketClientFactory.setBufferSize(100000); //set this size as you need
webSocketClientFactory.start();
WebSocketClient webSocketClient = webSocketClientFactory.newWebSocketClient();
webSocketClient.setMaxBinaryMessageSize(100000);//set this size as you need
webSocketClient.setMaxTextMessageSize(100000);//set this size as you need
webSocketClient.open(URI.create(urlConnect), webSocket);