NIMSDK-AOS 10.4.0-beta
载入中...
搜索中...
未找到
SecondTimeoutConfig.java
浏览该文件的文档.
1package com.netease.nimlib.sdk;
2
3import androidx.annotation.Nullable;
4
5import org.json.JSONException;
6import org.json.JSONObject;
7
8import java.io.Serializable;
9
10/**
11 * 第二超时时间配置,即408后继续等待回包的时长
12 */
13public class SecondTimeoutConfig implements Serializable {
14 public static final String KEY_SEND_MESSAGE_SECOND_TIMEOUT = "KEY_SEND_MESSAGE_SECOND_TIMEOUT";
15
16 /** 发消息第二超时 */
17 public long sendMessageSecondTimeout = 0;
18
19 public JSONObject toJson() {
20 JSONObject object = new JSONObject();
21 try {
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);
36 config.sendMessageSecondTimeout = sendMessageSecondTimeout;
37
38 return config;
39 }
40}
第二超时时间配置,即408后继续等待回包的时长
static SecondTimeoutConfig fromJson(@Nullable JSONObject object)