When I am sending binary data through a websocket in tomcat, I get a reserved bit set to n (n being a number between 1-7) error. This is caused by when the class WsFrame of tomcat is entered and the value of int b is set to input buffer, when this is set the value of int rsv (reserve bit) changes to a non 0 number. However b and rsv are never set to each other and thus the changing of b should have no effect on the value of rsv. I believe this may be due to memory corruption or another type of memory error where both values are being held at the same address in memory for some reason.
The sendbinary method is what causes this error to be thrown not send text or send object.
This is fixed in at least tomcat 7.0.53 and possibly any version greater then tomcat 7.0.53.