我使用com.koushikdutta.异步:android异步:2.1.3作为Android SocketIO客户端库。是否有方法更改库中的默认心跳间隔?
发布于 2015-10-30 00:40:48
心跳被定义为这里
connecting = httpClient.executeString(request, null)
.then(new TransformFuture<SocketIOTransport, String>() {
@Override
protected void transform(String result) throws Exception {
String[] parts = result.split(":");
final String sessionId = parts[0];
if (!"".equals(parts[1]))
heartbeat = Integer.parseInt(parts[1]) / 2 * 1000;
else
heartbeat = 0;
它的回退值为0,但它的实际值来自
Integer.parseInt(parts[1]) / 2 * 1000;
AndroidAsync使用的心跳来自从服务器发送的值: 心跳= Integer.parseInt(parts1) /2* 1000;
不能手动更改心跳值。
https://stackoverflow.com/questions/32971838
复制