不能發送超過8KB的消息,下面是錯誤如何增加輸出緩衝器,因爲我已經使用sockjs的WebSocket服務器的春天落實和春季sockjs的WebSocket服務器實現
2014-02-12 19:36:29,990 - org.springframework.web.socket.sockjs.transport.session.WebSocketServerSockJsSession - DEBUG - SockJS session id=35n41xel was closed, CloseStatus [code=1009, reason=The decoded text message was too big for the output buffer and the endpoint does not support partial messages]
任何想法我怎麼能增加緩衝大小
我用下列工廠作爲彈簧sockjs利用Tomcat容器(應用程序部署在Tomcat和我也調試以確認它確實使用Tomcat LIB)
@Bean
public WebSocketContainerFactoryBean createWebSocketContainer() {
WebSocketContainerFactoryBean container = new WebSocketContainerFactoryBean();
container.setMaxTextMessageBufferSize(16384);
container.setMaxBinaryMessageBufferSize(8192);
return container;
}
然後我的URL映射看起來
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
registry.addHandler(coBrowseSockJsCustomerHandler(), "/sockjs/cobrowse/customer/").withSockJS();}
我是否需要設置這個bean與sockjs地方? sockjs如何知道它必須使用這個技術?
您指定的數字位,字節或kb? – BiJ
這工作,如果我傳遞文件從客戶端到服務器,但不,如果我senf文件從服務器到客戶端 – gstackoverflow