左晓为主开发手持机充值管理机
zuoxiao
2023-11-14 5a843ba11b991722f8f2af386f0e546e2769f7c3
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
package com.easysocket.interfaces.conn;
 
import com.easysocket.entity.SocketAddress;
import com.easysocket.interfaces.callback.ICallBack;
import com.easysocket.interfaces.config.IOptions;
 
import java.io.InputStream;
import java.io.OutputStream;
 
/**
 * Author:Alex
 * Date:2019/5/29
 * Note:连接管理的接口规范
 */
public interface IConnectionManager extends ISubscribeSocketAction, IOptions<IConnectionManager>,ISend, ICallBack {
    /**
     * 开始连接
     */
    void connect();
 
    /**
     * 关闭连接
     * @param isNeedReconnect 是否需要重连
     */
    void disconnect(boolean isNeedReconnect);
 
 
    /**
     * 获取socket连接状态
     * @return
     */
    int getConnectionStatus();
 
    /**
     * 是否可连接的
     * @return
     */
    boolean isConnectViable();
 
    /**
     * 切换host
     * @param socketAddress
     */
    void switchHost(SocketAddress socketAddress);
 
    /**
     * 获取输入流
     * @return
     */
    InputStream getInputStream();
 
    /**
     * 获取输出流
     * @return
     */
    OutputStream getOutStream();
 
    /**
     * 获取心跳管理器
     * @return
     */
    IHeartManager getHeartManager();
 
 
}