public void receiveFrame(WebSocketFrame frame) {
ERXApplication._startRequest();
try {
if(frame instanceof TextWebSocketFrame) {
TextWebSocketFrame textFrame = (TextWebSocketFrame)frame;
receive(textFrame.getText());
} else if(frame instanceof BinaryWebSocketFrame && frame.getBinaryData().hasArray()) {
//Not supported. May change drastically.
receive(frame.getBinaryData().array());
} else {
String message = String.format("%s frame types not supported", frame.getClass().getName());