All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.ably.lib.network.DefaultWebSocketEngine Maven / Gradle / Ivy

There is a newer version: 1.2.47
Show newest version
package io.ably.lib.network;

import java.net.URI;

public class DefaultWebSocketEngine implements WebSocketEngine {
    private final WebSocketEngineConfig config;

    public DefaultWebSocketEngine(WebSocketEngineConfig config) {
        this.config = config;
    }

    @Override
    public WebSocketClient create(String url, WebSocketListener listener) {
        DefaultWebSocketClient client =  new DefaultWebSocketClient(URI.create(url), listener, config);
        if (config.isTls()) {
            client.setSocketFactory(config.getSslSocketFactory());
        }
        return client;
    }

    @Override
    public boolean isPingListenerSupported() {
        return true;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy