Package org.glassfish.grizzly.websockets

Examples of org.glassfish.grizzly.websockets.SimpleWebSocket


                context.getProtocolHandler().setConnection(ctx.getConnection());

                final GrizzlyWebSocketAdapter webSocketAdapter = createWebSocketAdapter(context);
                context.setWebSocket(webSocketAdapter);
                SimpleWebSocket ws = webSocketAdapter.getGrizzlyWebSocket();
                if (context.getCurrentState() == UPGRADE) {
                    httpHeader.setChunked(false);
                    ws.onConnect();
                    WebSocketHolder.set(ctx.getConnection(), context.getProtocolHandler(), ws);
                    ((WebSocketUpgradeHandler) context.getHandler()).onSuccess(context.getWebSocket());
                    final int wsTimeout = context.getProvider().getClientConfig().getWebSocketTimeout();
                    IdleTimeoutFilter.setCustomTimeout(ctx.getConnection(), ((wsTimeout <= 0) ? IdleTimeoutFilter.FOREVER : wsTimeout),
                            TimeUnit.MILLISECONDS);
View Full Code Here


        }
    }

    @SuppressWarnings("rawtypes")
    private static GrizzlyWebSocketAdapter createWebSocketAdapter(final HttpTxContext context) {
        SimpleWebSocket ws = new SimpleWebSocket(context.getProtocolHandler());
        AsyncHttpProviderConfig config = context.getProvider().getClientConfig().getAsyncHttpProviderConfig();
        boolean bufferFragments = true;
        if (config instanceof GrizzlyAsyncHttpProviderConfig) {
            bufferFragments = (Boolean) ((GrizzlyAsyncHttpProviderConfig) config)
                    .getProperty(GrizzlyAsyncHttpProviderConfig.Property.BUFFER_WEBSOCKET_FRAGMENTS);
View Full Code Here

TOP

Related Classes of org.glassfish.grizzly.websockets.SimpleWebSocket

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.