Framework.Net网络管理
This commit is contained in:
29
client/assets/scripts/Framework/Net/NetConfig.ts
Normal file
29
client/assets/scripts/Framework/Net/NetConfig.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 网络配置接口
|
||||
*/
|
||||
export interface NetConfig {
|
||||
/** 服务器地址 */
|
||||
serverUrl: string;
|
||||
|
||||
/** 超时时间(ms) 默认 30000 */
|
||||
timeout?: number;
|
||||
|
||||
/** 是否自动重连 默认 true */
|
||||
autoReconnect?: boolean;
|
||||
|
||||
/** 重连间隔(ms) 默认 3000 */
|
||||
reconnectInterval?: number;
|
||||
|
||||
/** 最大重连次数 默认 5 */
|
||||
maxReconnectTimes?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认网络配置
|
||||
*/
|
||||
export const DefaultNetConfig: Partial<NetConfig> = {
|
||||
timeout: 30000,
|
||||
autoReconnect: true,
|
||||
reconnectInterval: 3000,
|
||||
maxReconnectTimes: 5
|
||||
};
|
||||
Reference in New Issue
Block a user