Package org.eclipse.jetty.websocket.client

Examples of org.eclipse.jetty.websocket.client.ClientUpgradeRequest


    {
        Objects.requireNonNull(instance,"EndpointInstance cannot be null");
        Objects.requireNonNull(path,"Path cannot be null");

        ClientEndpointConfig config = (ClientEndpointConfig)instance.getConfig();
        ClientUpgradeRequest req = new ClientUpgradeRequest();
        UpgradeListener upgradeListener = null;

        for (Extension ext : config.getExtensions())
        {
            req.addExtensions(new JsrExtensionConfig(ext));
        }

        if (config.getPreferredSubprotocols().size() > 0)
        {
            req.setSubProtocols(config.getPreferredSubprotocols());
        }

        if (config.getConfigurator() != null)
        {
            upgradeListener = new JsrUpgradeListener(config.getConfigurator());
View Full Code Here


        SslContextFactory sslContexFactory = new SslContextFactory();
        sslContexFactory.setTrustAll(isIgnoreSslErrors());
        webSocketClient = new WebSocketClient(sslContexFactory);
       
        webSocketClient.start();
        ClientUpgradeRequest request = new ClientUpgradeRequest();
        webSocketClient.connect(socket, uri, request);
       
        int connectionTimeout = Integer.parseInt(getConnectionTimeout());
        socket.awaitOpen(connectionTimeout, TimeUnit.MILLISECONDS);
       
View Full Code Here

            socket = new ServiceSocket(this, webSocketClient);
        }

        //Start WebSocket client thread and upgrage HTTP connection
        webSocketClient.start();
        ClientUpgradeRequest request = new ClientUpgradeRequest();
        webSocketClient.connect(socket, uri, request);
       
        //Get connection timeout or use the default value
        int connectionTimeout;
        try {
View Full Code Here

    URI wsEvents = new URI("ws://" + uri.getHost() + ":" + uri.getPort() + "/events");

    final Queue<String> messages = new LinkedBlockingQueue<>();
    final EventClientSocket socket = new EventClientSocket(messages);

    ClientUpgradeRequest request = new ClientUpgradeRequest();
    wsClient.connect(socket, wsEvents, request);

    client.target(uri).path("/raft/init").request().post(Entity.json(""));

    new Prober(new Callable<Boolean>() {
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.websocket.client.ClientUpgradeRequest

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.