本文整理了Java中io.socket.yeast.Yeast
类的一些代码示例,展示了Yeast
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Yeast
类的具体详情如下:
包路径:io.socket.yeast.Yeast
类名称:Yeast
[英]A Java implementation of yeast. https://github.com/unshiftio/yeast
[中]酵母的Java实现。https://github.com/unshiftio/yeast
代码示例来源:origin: io.socket/engine.io-server
public static String yeast() {
return Yeast.encode(VALUE.incrementAndGet());
}
}
代码示例来源:origin: io.socket/engine.io-client
protected String uri() {
Map<String, String> query = this.query;
if (query == null) {
query = new HashMap<String, String>();
}
String schema = this.secure ? "wss" : "ws";
String port = "";
if (this.port > 0 && (("wss".equals(schema) && this.port != 443)
|| ("ws".equals(schema) && this.port != 80))) {
port = ":" + this.port;
}
if (this.timestampRequests) {
query.put(this.timestampParam, Yeast.yeast());
}
String derivedQuery = ParseQS.encode(query);
if (derivedQuery.length() > 0) {
derivedQuery = "?" + derivedQuery;
}
boolean ipv6 = this.hostname.contains(":");
return schema + "://" + (ipv6 ? "[" + this.hostname + "]" : this.hostname) + port + this.path + derivedQuery;
}
}
代码示例来源:origin: io.socket/engine.io-client
protected String uri() {
Map<String, String> query = this.query;
if (query == null) {
query = new HashMap<String, String>();
}
String schema = this.secure ? "https" : "http";
String port = "";
if (this.timestampRequests) {
query.put(this.timestampParam, Yeast.yeast());
}
String derivedQuery = ParseQS.encode(query);
if (this.port > 0 && (("https".equals(schema) && this.port != 443)
|| ("http".equals(schema) && this.port != 80))) {
port = ":" + this.port;
}
if (derivedQuery.length() > 0) {
derivedQuery = "?" + derivedQuery;
}
boolean ipv6 = this.hostname.contains(":");
return schema + "://" + (ipv6 ? "[" + this.hostname + "]" : this.hostname) + port + this.path + derivedQuery;
}
代码示例来源:origin: io.socket/engine.io-client
public static String yeast() {
String now = encode(new Date().getTime());
if (!now.equals(prev)) {
seed = 0;
prev = now;
return now;
}
return now + "." + encode(seed++);
}
}
内容来源于网络,如有侵权,请联系作者删除!