示例#1
0
 /// <summary>
 /// 初始化 imclient
 /// </summary>
 /// <param name="options"></param>
 public ImClient(ImClientOptions options)
 {
     if (options.Redis == null)
     {
         throw new ArgumentException("ImClientOptions.Redis 参数不能为空");
     }
     if (options.Servers.Any() == false)
     {
         throw new ArgumentException("ImClientOptions.Servers 参数不能为空");
     }
     _redis       = options.Redis;
     _servers     = options.Servers;
     _redisPrefix = $"wsim{options.PathMatch.Replace('/', '_')}";
     _pathMatch   = options.PathMatch ?? "/ws";
 }
示例#2
0
 /// <summary>
 /// 初始化 ImHelper
 /// </summary>
 /// <param name="options"></param>
 public static void Initialization(ImClientOptions options)
 {
     _instance = new ImClient(options);
 }