private static IPlayerGateway InitPlayerGateway() { using (ILogMethod method = Log.LogMethod("HandlerHelper", "InitPlayerGateway")) { IPlayerGateway gateway = default(IPlayerGateway); try { gateway = GatewayFactory.GetGateway(GatewayType.SDT); gateway.Initialize(); gateway.SocketSenderPT2.ReceiveTimeout = GatewaySettings.PTAsyncReceiveTimeout; gateway.SocketSenderPT.ReceiveTimeout = GatewaySettings.PTAsyncReceiveTimeout; gateway.SocketSenderCA2.ReceiveTimeout = GatewaySettings.CAAsyncReceiveTimeout; gateway.SocketSenderCA.ReceiveTimeout = GatewaySettings.CAAsyncReceiveTimeout; gateway.SocketSenderPT.Initialize(_configStore.PT_GATEWAY_IP, _configStore.SDT_SendPTPortNo); gateway.SocketSenderPT2.Initialize(_configStore.PT_GATEWAY_IP, _configStore.SDT_ReceivePTPortNo); gateway.SocketSenderCA.Initialize(_configStore.PT_GATEWAY_IP, _configStore.SDT_SendCAPortNo); gateway.SocketSenderCA2.Initialize(_configStore.PT_GATEWAY_IP, _configStore.SDT_ReceiveCAPortNo); if (GatewaySettings.SocketSendWithoutReconnect) { gateway.SocketSenderPT.SendTimeout = GatewaySettings.PTAsyncSendTimeout; gateway.SocketSenderCA.SendTimeout = GatewaySettings.CAAsyncSendTimeout; } } catch (Exception ex) { method.Exception(ex); } return(gateway); } }
public CPlayerData() { InitializeComponent(); cmbMessageTypes.ItemsSource = GetMessageTypes(); LogManager.WriteLog("CPlayerData[GateWay Initializing]", LogManager.enumLogLevel.Debug); try { BMC.PlayerGateway.SharedData.ActiveLogger.WriteToExternalLog += new BMC.PlayerGateway.WriteToExternalLogHandler(ActiveLogger_WriteToExternalLog); BMC.PlayerGateway.GatewaySettings.GlobalExecutorService = ExecutorServiceFactory.CreateExecutorService(); oGateWay = GatewayFactory.GetGateway(GatewayType.SDT); BMC.PlayerGateway.GatewaySettings.ConnectionString = oCommonUtilities.CreateInstance().GetConnectionString(); oGateWay.Initialize(true); oGateWay.SocketSenderPT.Initialize(Settings.PT_GATEWAY_IP, Settings.SDT_SendPTPortNo); oGateWay.SocketSenderCA.Initialize(Settings.PT_GATEWAY_IP, Settings.SDT_SendCAPortNo); LogManager.WriteLog("CPlayerData[GateWay Initialized]", LogManager.enumLogLevel.Debug); } catch (Exception Ex) { ExceptionManager.Publish(Ex); } }
public void Initialize() { _gateways = _configuration.Gateways.Select(x => _factory.GetGateway(x.Name)).ToList(); }