using LJLib.Client; using LJLib.Net.SPI.Client; using LJProxy.Settings; using Microsoft.Extensions.Options; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace LJProxy.Services { public class LJClientPoolService { private AppSettings _appSettingModel; private ILJClient _pool; public LJClientPoolService(IOptions appSettingModel) { _appSettingModel = appSettingModel.Value; var url = _appSettingModel.L1SvrUrl; var urlArr = url.Split(':'); var ip = urlArr[0]; var port = urlArr[1]; var creator = new DirectP1ClientCreator(ip, Convert.ToInt32(port)); _pool = new LJClientPool(creator, _appSettingModel.ThreadSize); } public ILJClient Pool { get { return _pool; } } } }