yy1717
2020-08-12 539bdbbebc2410bbad25af01d9088594d02c95b0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
package com.anyun.im_lib.interf;
 
import com.anyun.im_lib.MsgDispatcher;
import com.anyun.im_lib.MsgTimeOutTimerManager;
import com.anyun.im_lib.listener.IMSConnectStatusCallback;
import com.anyun.im_lib.listener.OnEventListener;
 
import java.util.Vector;
 
/**
 * MyApplication2
 * Created by lzw on 2019/12/2. 11:58:51
 * 邮箱:632393724@qq.com
 * All Rights Saved! Chongqing AnYun Tech co. LTD
 */
public interface IMSClientInteface {
    /**
     * 初始化
     * @param serverUrlList
     * @param listener
     * @param callback
     */
    void init(Vector<String> serverUrlList, OnEventListener listener, IMSConnectStatusCallback callback);
 
    /**
     * 重置连接,也就是重连
     * 首次连接也可认为是重连
     */
    void resetConnect();
    /**
     * 重置连接,也就是重连
     * 首次连接也可认为是重连
     * 重载
     * @param isFirst  是否首次连接
     */
    void resetConnect(boolean isFirst);
 
    /**
     * 关闭连接,同时释放资源
     */
    void close();
 
    /**
     * 表示ims是否已经关闭
     * @return
     */
    boolean isClosed();
 
    /**
     * 发送消息
     * @param msg
     */
    void sendMsg(byte[] msg);
 
    /**
     * 发送消息
     * 重载
     * @param msg
     * @param isJoinTimeoutManager 是否加入超时管理器
     */
    void sendMsg(byte[] msg, boolean isJoinTimeoutManager);
 
    /**
     * 获取重连间隔时长
     * @return
     */
    int getReconnectInterval();
 
 
    /**
     * 获取连间隔时长
     * @return
     */
    int getConnectTimeout();
    /**
     * 获取应用在前台时心跳间隔
     * @return
     */
    int getForegroundHeartbeatInterval();
 
    /**
     * 设置app前后台状态
     * @param appStatus
     */
    void setAppStatus(int appStatus);
 
    /**
     * 获取应用在后台时心跳间隔
     * @return
     */
    int getBackgroundHeartbeatInterval();
 
    /**
     * 获取应用层消息发送超时重发次数
     * @return
     */
    int getResendCount();
 
    /**
     * 获取应用层消息发送超时间隔
     * @return
     */
    int getResendInterval();
 
    /**
     * 获取消息转发器
     * @return
     */
    MsgDispatcher getMsgDispatcher();
 
    MsgTimeOutTimerManager getMsgTimeOutTimerManager();
 
//获取注册消息
    byte[] getRegisterMessage();
 
    byte[] getHeartbeatMsg();
 
    void addHeartbeatHandler(int seconds);
 
    //设备是否登录,只有登录-true 才需要发心跳消息
    boolean isLogin();
}