Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Websocket max frame length of 65536 has been exceeded

In my scala application I use web sockets to get requests and send responses. When I try to pass a base64 string through web sockets following exception occurs

org.jboss.netty.handler.codec.frame.CorruptedFrameException: Max frame length of 65536 has been exceeded.

I tried the below solution to fix my issue

export SBT_OPTS="-Xms1024m -Xmx3084m -XX:MaxPermSize=1024m -Dhttp.netty.maxInitialLineLength=2621440"

It works well in the Mac OS. But when I try the same solution in my windows(changed export to set) and Ubuntu machine it doesn't work. I get the same exception message. Please help me to fix this issue. Thanks in advance

like image 782
mvm Avatar asked Oct 20 '15 10:10

mvm


2 Answers

The Default buffer size set for web socket is "65536". So you should increase the websocket buffer size in the application.conf file.

You can set the limit as given below.

play.websocket.buffer.limit=2621440
like image 84
SKK Avatar answered Oct 24 '22 09:10

SKK


Find a way to increase the maximum size of WebSocket frames. For example, in Java, Session.setMaxTextMessageBufferSize(int) and Session.setMaxBinaryMessageBufferSize(int).

like image 22
Takahiko Kawasaki Avatar answered Oct 24 '22 10:10

Takahiko Kawasaki