Class: init_config<CT>
index / network / websocket_ / init_config
Class: init_config<CT>
network.websocket_.init_config
初始化配置
Type parameters
Name | Type |
---|---|
CT | extends codec_base = codec_base |
Hierarchy
init_config
<CT
>↳
init_config
Table of contents
Constructors
Properties
- codec
- send_interval_ms_n
- reconnect_interval_ms_n
- max_reconnect_n
- wait_timeout_ms_n
- heartbeat_config
- binary_type
- protocol_ss
Methods
Constructors
constructor
• new init_config<CT
>(init_?
)
Type parameters
Name | Type |
---|---|
CT | extends codec_base = codec_base |
Parameters
Name | Type |
---|---|
init_? | Partial <init_config <CT >> |
Overrides
Defined in
assets/@framework/network/websocket/mk_websocket.ts:41
Properties
codec
• Optional
codec: CT
编解码器
Inherited from
Defined in
assets/@framework/network/mk_network_base.ts:637
send_interval_ms_n
• send_interval_ms_n: number
= 0
发送间隔
Remarks
单位:毫秒
Inherited from
init_config.send_interval_ms_n
Defined in
assets/@framework/network/mk_network_base.ts:643
reconnect_interval_ms_n
• reconnect_interval_ms_n: number
= 1000
重连间隔
Remarks
单位:毫秒
Inherited from
init_config.reconnect_interval_ms_n
Defined in
assets/@framework/network/mk_network_base.ts:649
max_reconnect_n
• max_reconnect_n: number
= 5
最大重连次数
Inherited from
Defined in
assets/@framework/network/mk_network_base.ts:651
wait_timeout_ms_n
• wait_timeout_ms_n: number
= 5000
等待消息超时时间
Remarks
单位:毫秒
Inherited from
Defined in
assets/@framework/network/mk_network_base.ts:657
heartbeat_config
• Optional
heartbeat_config: Object
心跳配置
Type declaration
Name | Type | Description |
---|---|---|
interval_ms_n? | number | 发送间隔 Remarks 单位:毫秒 |
timeout_ms_n | number | 超时时间 Remarks 单位:毫秒 |
init_f | (done_f : () => void ) => null | () => any | 初始化 |
Inherited from
Defined in
assets/@framework/network/mk_network_base.ts:659
binary_type
• binary_type: "arraybuffer"
| "blob"
= "arraybuffer"
通信类型
Defined in
assets/@framework/network/websocket/mk_websocket.ts:47
protocol_ss
• protocol_ss: string
[] = []
协议
Defined in
assets/@framework/network/websocket/mk_websocket.ts:49
Methods
parse_message_id_f
▸ parse_message_id_f(data
): string
| number
解析消息 id
Parameters
Name | Type | Description |
---|---|---|
data | any | 接收的消息 |
Returns
string
| number
消息号
Inherited from
init_config.parse_message_id_f
Defined in
assets/@framework/network/mk_network_base.ts:685
parse_message_sequence_f
▸ parse_message_sequence_f(data
): undefined
| string
| number
解析消息序列号
Parameters
Name | Type | Description |
---|---|---|
data | any | 接收的消息 |
Returns
undefined
| string
| number
消息序列号
Inherited from
init_config.parse_message_sequence_f