Class Helper
java.lang.Object
cool.scx.socket.Helper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic cool.scx.http.uri.ScxURIcreateConnectOptions(String absoluteURI, String clientID) 根据 uri 和 clientID 创建 ConnectOptionsstatic <T> Tstatic <T> Tstatic StringgetClientID(cool.scx.http.ScxServerWebSocket serverWebSocket) 从 ServerWebSocket 中获取 clientIDstatic longgetDelayed(int times) 根据次数获取延时时间 根据次数进行 2的 次方倍增 , 如 1, 2 ,4 ,8 ,16 等static String
-
Field Details
-
SCX_SOCKET_CLIENT_ID
- See Also:
-
-
Constructor Details
-
Helper
public Helper()
-
-
Method Details
-
getClientID
从 ServerWebSocket 中获取 clientID- Parameters:
serverWebSocket- serverWebSocket- Returns:
- clientID 没有返回 null
-
createConnectOptions
-
getDelayed
public static long getDelayed(int times) 根据次数获取延时时间 根据次数进行 2的 次方倍增 , 如 1, 2 ,4 ,8 ,16 等- Parameters:
times- 次数 (0 起始)- Returns:
- 延时时间 (毫秒)
-
toJson
-
fromJson
-
fromJson
public static <T> T fromJson(String json, com.fasterxml.jackson.core.type.TypeReference<T> valueTypeRef)
-