samedi 20 février 2016

Jetty websocket client.start does not there

I am trying to use a websocket connection and for this I am using the example http://ift.tt/V1AQ5M in this example for client the method start doesnt exist in WebSocket client

    import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
    import org.eclipse.jetty.websocket.client.WebSocketClient;
    ......
    WebSocketClient client = new WebSocketClient();
    SimpleEchoSocket socket = new SimpleEchoSocket();
    try {
        client.start(); //this method doesnt exist
        URI echoUri = new URI(destUri);
        ClientUpgradeRequest request = new ClientUpgradeRequest();
        client.connect(socket, echoUri, request);
        System.out.printf("Connecting to : %s%n", echoUri);
        socket.awaitClose(5, TimeUnit.SECONDS);
    } catch (Throwable t) {}

In this code in the line client.start() I am getting an error the method doesnt exist. I dont get information about this method or stop method that use too.

Anybody has any information about this method or any clues why it tell me that those methods doesnt exist? I am importing 2 classes

Aucun commentaire:

Enregistrer un commentaire