コード例 #1
0
 public YamsClient(YamsClientConfig config, IIpcConnection initConnection, IIpcConnection exitConnection,
                   IIpcConnection healthConnection)
 {
     _config           = config;
     _initConnection   = initConnection;
     _exitConnection   = exitConnection;
     _healthConnection = healthConnection;
 }
コード例 #2
0
ファイル: YamsClientFactory.cs プロジェクト: youscan/Yams
        public IYamsClient CreateYamsClient(YamsClientConfig config)
        {
            var options = _processArgsParser.ParseArgs(config.ProcessArgs);

            IpcConnection initConnection   = null;
            IpcConnection exitConnection   = null;
            IpcConnection healthConnection = null;

            if (!string.IsNullOrEmpty(options.InitializationPipeName))
            {
                initConnection = new IpcConnection(new NamedPipeClientAdapter(options.InitializationPipeName));
            }
            if (!string.IsNullOrEmpty(options.ExitPipeName))
            {
                exitConnection = new IpcConnection(new NamedPipeClientAdapter(options.ExitPipeName));
            }
            if (!string.IsNullOrEmpty(options.HealthPipeName))
            {
                healthConnection = new IpcConnection(new NamedPipeClientAdapter(options.HealthPipeName));
            }
            return(new YamsClient(config, initConnection, exitConnection, healthConnection));
        }