/** * Method handles Grizzly {@link Connection} close phase. Check if the {@link Connection} is a {@link WebSocket}, if * yes - tries to close the websocket gracefully (sending close frame) and calls {@link * WebSocket#onClose(DataFrame)}. If the Grizzly {@link Connection} is not websocket - passes processing to the next * filter in the chain. * * @param ctx {@link FilterChainContext} * * @return {@link NextAction} instruction for {@link FilterChain}, how it should continue the execution * * @throws java.io.IOException */ @Override public NextAction handleClose(FilterChainContext ctx) throws IOException { // Get the Connection final Connection connection = ctx.getConnection(); // check if Connection has associated WebSocket (is websocket) if (webSocketInProgress(connection)) { // if yes - get websocket final WebSocket ws = getWebSocket(connection); if (ws != null) { // if there is associated websocket object (which means handshake was passed) // close it gracefully ws.close(); } } return ctx.getInvokeAction(); }
/** * Method handles Grizzly {@link Connection} close phase. Check if the {@link Connection} is a {@link WebSocket}, if * yes - tries to close the websocket gracefully (sending close frame) and calls {@link * WebSocket#onClose(DataFrame)}. If the Grizzly {@link Connection} is not websocket - passes processing to the next * filter in the chain. * * @param ctx {@link FilterChainContext} * * @return {@link NextAction} instruction for {@link FilterChain}, how it should continue the execution * * @throws java.io.IOException */ @Override public NextAction handleClose(FilterChainContext ctx) throws IOException { // Get the Connection final Connection connection = ctx.getConnection(); // check if Connection has associated WebSocket (is websocket) if (webSocketInProgress(connection)) { // if yes - get websocket final WebSocket ws = getWebSocket(connection); if (ws != null) { // if there is associated websocket object (which means handshake was passed) // close it gracefully ws.close(); } } return ctx.getInvokeAction(); }
/** * Method handles Grizzly {@link Connection} close phase. Check if the {@link Connection} is a {@link WebSocket}, if * yes - tries to close the websocket gracefully (sending close frame) and calls {@link * WebSocket#onClose(DataFrame)}. If the Grizzly {@link Connection} is not websocket - passes processing to the next * filter in the chain. * * @param ctx {@link FilterChainContext} * * @return {@link NextAction} instruction for {@link FilterChain}, how it should continue the execution * * @throws java.io.IOException */ @Override public NextAction handleClose(FilterChainContext ctx) throws IOException { // Get the Connection final Connection connection = ctx.getConnection(); // check if Connection has associated WebSocket (is websocket) if (webSocketInProgress(connection)) { // if yes - get websocket final WebSocket ws = getWebSocket(connection); if (ws != null) { // if there is associated websocket object (which means handshake was passed) // close it gracefully ws.close(); } } return ctx.getInvokeAction(); }
/** * Method handles Grizzly {@link Connection} close phase. Check if the {@link Connection} is a {@link WebSocket}, if * yes - tries to close the websocket gracefully (sending close frame) and calls {@link * WebSocket#onClose(DataFrame)}. If the Grizzly {@link Connection} is not websocket - passes processing to the next * filter in the chain. * * @param ctx {@link FilterChainContext} * * @return {@link NextAction} instruction for {@link FilterChain}, how it should continue the execution * * @throws java.io.IOException */ @Override public NextAction handleClose(FilterChainContext ctx) throws IOException { // Get the Connection final Connection connection = ctx.getConnection(); // check if Connection has associated WebSocket (is websocket) if (webSocketInProgress(connection)) { // if yes - get websocket final WebSocket ws = getWebSocket(connection); if (ws != null) { // if there is associated websocket object (which means handshake was passed) // close it gracefully ws.close(); } } return ctx.getInvokeAction(); }
/** * Method handles Grizzly {@link Connection} close phase. Check if the {@link Connection} is a {@link WebSocket}, if * yes - tries to close the websocket gracefully (sending close frame) and calls {@link * WebSocket#onClose(DataFrame)}. If the Grizzly {@link Connection} is not websocket - passes processing to the next * filter in the chain. * * @param ctx {@link FilterChainContext} * * @return {@link NextAction} instruction for {@link FilterChain}, how it should continue the execution * * @throws java.io.IOException */ @Override public NextAction handleClose(FilterChainContext ctx) throws IOException { // Get the Connection final Connection connection = ctx.getConnection(); // check if Connection has associated WebSocket (is websocket) if (webSocketInProgress(connection)) { // if yes - get websocket final WebSocket ws = getWebSocket(connection); if (ws != null) { // if there is associated websocket object (which means handshake was passed) // close it gracefully ws.close(); } } return ctx.getInvokeAction(); }
/** * Method handles Grizzly {@link Connection} close phase. Check if the {@link Connection} is a {@link WebSocket}, if * yes - tries to close the websocket gracefully (sending close frame) and calls {@link * WebSocket#onClose(DataFrame)}. If the Grizzly {@link Connection} is not websocket - passes processing to the next * filter in the chain. * * @param ctx {@link FilterChainContext} * * @return {@link NextAction} instruction for {@link FilterChain}, how it should continue the execution * * @throws java.io.IOException */ @Override public NextAction handleClose(FilterChainContext ctx) throws IOException { // Get the Connection final Connection connection = ctx.getConnection(); // check if Connection has associated WebSocket (is websocket) if (webSocketInProgress(connection)) { // if yes - get websocket final WebSocket ws = getWebSocket(connection); if (ws != null) { // if there is associated websocket object (which means handshake was passed) // close it gracefully ws.close(); } } return ctx.getInvokeAction(); }
if (!webSocketInProgress(connection) && !"websocket".equalsIgnoreCase(header.getUpgrade())) {
if (!webSocketInProgress(connection) && !"websocket".equalsIgnoreCase(header.getUpgrade())) {
if (!webSocketInProgress(connection) && !"websocket".equalsIgnoreCase(header.getUpgrade())) {
if (!webSocketInProgress(connection) && !"websocket".equalsIgnoreCase(header.getUpgrade())) {
if (!webSocketInProgress(connection) && !"websocket".equalsIgnoreCase(header.getUpgrade())) {
if (!webSocketInProgress(connection) && !"websocket".equalsIgnoreCase(header.getUpgrade())) {