NIMSDK-AOS  9.16.0
SecondTimeoutConfig.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk;
2 
3 import androidx.annotation.Nullable;
4 
5 import org.json.JSONException;
6 import org.json.JSONObject;
7 
8 import java.io.Serializable;
9 
13 public class SecondTimeoutConfig implements Serializable {
14  public static final String KEY_SEND_MESSAGE_SECOND_TIMEOUT = "KEY_SEND_MESSAGE_SECOND_TIMEOUT";
15 
17  public long sendMessageSecondTimeout = 0;
18 
19  public JSONObject toJson() {
20  JSONObject object = new JSONObject();
21  try {
22  object.putOpt(KEY_SEND_MESSAGE_SECOND_TIMEOUT, sendMessageSecondTimeout);
23  } catch (JSONException e) {
24  e.printStackTrace();
25  }
26  return object;
27  }
28 
29  public static SecondTimeoutConfig fromJson(@Nullable JSONObject object) {
30  if (object == null) {
31  return null;
32  }
33 
34  final long sendMessageSecondTimeout = object.optLong(KEY_SEND_MESSAGE_SECOND_TIMEOUT, 0L);
37 
38  return config;
39  }
40 }
long sendMessageSecondTimeout
发消息第二超时
第二超时时间配置,即408后继续等待回包的时长
static SecondTimeoutConfig fromJson(@Nullable JSONObject object)