Package com.pusher.client.connection.websocket

Examples of com.pusher.client.connection.websocket.WebSocketConnection


    @Before
    public void setUp() throws Exception {
        pusherOptions = new PusherOptions().setAuthorizer(mockAuthorizer).setEncrypted(false);

        connection = new WebSocketConnection(pusherOptions.buildUrl(API_KEY), ACTIVITY_TIMEOUT, PONG_TIMEOUT, factory);

        when(factory.getEventQueue()).thenReturn(new InstantExecutor());
        when(factory.getTimers()).thenReturn(new DoNothingExecutor());
        when(factory.newWebSocketClientWrapper(any(URI.class), any(WebSocketListener.class))).thenAnswer(new Answer<WebSocketClientWrapper>() {
            @Override
View Full Code Here


    private ScheduledExecutorService timers;

    public synchronized InternalConnection getConnection(String apiKey, PusherOptions options) {
        if (connection == null) {
            try {
                connection = new WebSocketConnection(options.buildUrl(apiKey),
                                                     options.getActivityTimeout(),
                                                     options.getPongTimeout(),
                                                     this);
            } catch (URISyntaxException e) {
                throw new IllegalArgumentException("Failed to initialise connection", e);
View Full Code Here

TOP

Related Classes of com.pusher.client.connection.websocket.WebSocketConnection

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.