Package se.cgbystrom.netty.http.websocket

Examples of se.cgbystrom.netty.http.websocket.WebSocketClient


        startServer(new WebSocketServerHandler());

        WebSocketClientFactory clientFactory = new WebSocketClientFactory();
        final TestClient callback = new TestClient();

        WebSocketClient client = clientFactory.newClient(new URI("ws://localhost:" + port + "/websocket"), callback);

        client.connect().awaitUninterruptibly();
        Thread.sleep(1000);

        assertTrue(callback.connected);
        assertEquals(TestClient.TEST_MESSAGE.toUpperCase(), callback.messageReceived);
        client.disconnect();
        Thread.sleep(1000);

        assertFalse(callback.connected);
    }
View Full Code Here

TOP

Related Classes of se.cgbystrom.netty.http.websocket.WebSocketClient

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.