bmv.org.pushca.client.WsConnectionWithJavaWebSocketFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pushca-client Show documentation
Show all versions of pushca-client Show documentation
Advanced client for Pushca server, without connection pool support
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;
}
}