io.cloudboost.util.CloudSocket Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JavaSDK Show documentation
Show all versions of JavaSDK Show documentation
An open source Java SDK for CloudBoost developing apps
package io.cloudboost.util;
import java.net.URISyntaxException;
import io.socket.client.IO;
import io.socket.client.Socket;
/**
*
* @author cloudboost
*
*/
public class CloudSocket{
private static Socket socket;
/**
*
* Socket Initialization
*
* @param url
*/
public static void init(String url){
try {
setSocket(IO.socket(url));
} catch (URISyntaxException e) {
e.printStackTrace();
}
}
public static Socket getSocket() {
return socket;
}
public static void setSocket(Socket socket) {
CloudSocket.socket = socket;
}
}