Framework.Net网络管理

This commit is contained in:
janing
2025-12-14 22:39:43 +08:00
parent cf77482fc2
commit e09105ca0b
12 changed files with 1042 additions and 0 deletions

View 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
};