@Override protected FrameHeaderData parseFrame(ByteBuffer data) throws IOException { if (partialFrame == null) { partialFrame = receiveFrame(); } try { partialFrame.handle(data); } catch (WebSocketException e) { //the data was corrupt //send a close message WebSockets.sendClose(new CloseMessage(CloseMessage.WRONG_CODE, e.getMessage()).toByteBuffer(), this, null); markReadsBroken(e); if (WebSocketLogger.REQUEST_LOGGER.isDebugEnabled()) { WebSocketLogger.REQUEST_LOGGER.debugf(e, "receive failed due to Exception"); } throw new IOException(e); } if (partialFrame.isDone()) { PartialFrame p = this.partialFrame; this.partialFrame = null; return p; } return null; }
@Override protected FrameHeaderData parseFrame(ByteBuffer data) throws IOException { if (partialFrame == null) { partialFrame = receiveFrame(); } try { partialFrame.handle(data); } catch (WebSocketException e) { //the data was corrupt //send a close message WebSockets.sendClose(new CloseMessage(CloseMessage.WRONG_CODE, e.getMessage()).toByteBuffer(), this, null); markReadsBroken(e); if (WebSocketLogger.REQUEST_LOGGER.isDebugEnabled()) { WebSocketLogger.REQUEST_LOGGER.debugf(e, "receive failed due to Exception"); } throw new IOException(e); } if (partialFrame.isDone()) { PartialFrame p = this.partialFrame; this.partialFrame = null; return p; } return null; }
@Override protected FrameHeaderData parseFrame(ByteBuffer data) throws IOException { if (partialFrame == null) { partialFrame = receiveFrame(); } try { partialFrame.handle(data); } catch (WebSocketException e) { //the data was corrupt //send a close message WebSockets.sendClose(new CloseMessage(CloseMessage.WRONG_CODE, e.getMessage()).toByteBuffer(), this, null); markReadsBroken(e); if (WebSocketLogger.REQUEST_LOGGER.isDebugEnabled()) { WebSocketLogger.REQUEST_LOGGER.debugf(e, "receive failed due to Exception"); } throw new IOException(e); } if (partialFrame.isDone()) { PartialFrame p = this.partialFrame; this.partialFrame = null; return p; } return null; }