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

bmv.org.pushca.client.WsConnectionWithJavaWebSocketFactory Maven / Gradle / Ivy

The newest version!
package bmv.org.pushca.client;

import java.net.URI;
import java.util.function.BiConsumer;
import javax.net.ssl.SSLContext;

public class WsConnectionWithJavaWebSocketFactory implements WsConnectionFactory {

  @Override
  public WebSocketApi createConnection(URI wsUrl, int connectTimeoutMs,
      BiConsumer messageConsumer,
      BiConsumer dataConsumer,
      BiConsumer onCloseListener, SSLContext sslContext) {
    JavaWebSocket ws = new JavaWebSocket(wsUrl,
        connectTimeoutMs,
        messageConsumer,
        dataConsumer,
        onCloseListener,
        sslContext);
    ws.connect();
    return ws;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy