final byte[] handShakeData = handshake.generateResponse(event);
// write the handshake data
event.getHttpServletResponse().getOutputStream().write(handShakeData);
/**
* Obtain an WebSocket instance from the handshaker.
*/
final WebSocket webSocket
= handshake.getWebSocket(event.getHttpServletRequest(), event.getHttpServletResponse(),
new ClosingStrategy() {
public void doClose() throws IOException{
event.close();
}
});
log.debug("Using WebSocket implementation: " + webSocket.getClass().getName());
/**
* Record a reference to this WebSocket into the HttpServletRequest so it can be re-referenced
* on READ, ERROR, and EOF events.
*/