shikeying
2024-01-11 3b67e947e36133e2a40eb2737b15ea375e157ea0
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
package com.walker.tcp;
 
public interface TcpEngine {
 
    int getPort();
 
    /**
     * 返回通信引擎名字,由业务设置
     * @return
     */
    String getName();
 
    /**
     * 是否支持长连接,默认支持
     * @return
     */
    boolean supportLongConnection();
 
    /**
     * 返回连接管理器,注意:该方法只有长连接时才存在
     * @return
     */
    ConnectionManager getConnectionManager();
 
    void start() throws Exception;
 
    void shutdown() throws Exception;
 
    /**
     * 通过长连接,向客户端发送异步消息
     * @param response
     * @return 返回(失败)信息,返回null表示通道发送成功。
     */
    String sendResponse(Response<?> response);
 
    long getStartTime();
 
    /**
     * 引擎ID
     * @return
     */
    int getId();
}