コード例 #1
0
 /// <summary>
 /// 指定した出力ストリームを出力ストリームリストに追加します
 /// </summary>
 /// <param name="stream">追加する出力ストリーム</param>
 public IDisposable AddOutputStream(IChannelSink stream)
 {
     ReplaceCollection(ref sinks, old => old.Add(stream));
     return(new ChannelSinkSubscription {
         Channel = this, Sink = stream
     });
 }
コード例 #2
0
 public TestConnection(ISocket socket, IChannelSink sink, string id, INetworkConfig config, CancellationTokenSource source, ILogger logger, Func <ReadOnlySequence <byte> > buildAliveMessage)
     : base(id, config, source, logger)
 {
     _socket = socket;
     _sink   = sink;
     StartPipeline();
 }
コード例 #3
0
 public MsmqSource(IChannelSink sink, string queues, int threadCount, int receiveTimeout, int retryTimeout)
 {
     _sink           = sink;
     _queues         = queues;
     _threadCount    = threadCount;
     _retryTimeout   = retryTimeout;
     _receiveTimeout = receiveTimeout;
 }
        public ConnectionInitiatedByPeer(string id, INetworkConfig config, ISocket socket, IChannelSink sink, CancellationTokenSource source, ILogger logger)
            : base(id, config, source, logger)
        {
            var ipEndPoint = (IPEndPoint)socket.Required(nameof(socket)).RemoteEndPoint;

            NetworkAddress = ipEndPoint.Address.ToString();
            NetworkPort    = ipEndPoint.Port;
            _socket        = socket;
            _sink          = sink;
            StartPipeline();
        }
コード例 #5
0
ファイル: MsmqSourceWorker.cs プロジェクト: formist/LinkMe
        public MsmqSourceWorker(EventSource eventSource, IChannelSink channel, string queuePath, TimeSpan receiveTimeout, TimeSpan retryTimeout, WaitHandle stopSignal)
        {
            _eventSource    = eventSource;
            _sink           = channel;
            _queue          = new MessageQueue("FormatName:" + queuePath);
            _receiveTimeout = receiveTimeout;
            _retryTimeout   = retryTimeout;
            _stopSignal     = stopSignal;

            _thread = new Thread(Run);
        }
コード例 #6
0
ファイル: LoadRunner.cs プロジェクト: formist/LinkMe
        void IChannelSource.Open()
        {
            const string method = "Open";

            _stopSignal      = new ManualResetEvent(false);
            _pauseSignal     = new ManualResetEvent(false);
            _continueSignal  = new ManualResetEvent(true);
            _pauseSignals    = new[] { _stopSignal, _pauseSignal };
            _continueSignals = new[] { _stopSignal, _continueSignal };

            _stepRunner = new StepRunner();

            _counters = new ScenarioCounters("test", _users);

            // Setup the details for each profile.

            _profileData = new List <ProfileData>();
            var currentPercentage = 0;
            var runnableProfiles  = 0;

            foreach (var profile in _profiles)
            {
                var profileCounters = CreateCounters(_counters, profile);

                // The percentage can be specified down to 0.01% so multiply by 100.

                currentPercentage += profile.Percentage * 100;
                if (profile.Runnable)
                {
                    ++runnableProfiles;
                }

                _profileData.Add(new ProfileData(profile, profileCounters, currentPercentage));
            }

            // Check the percentages.

            if (currentPercentage != 10000)
            {
                throw new InvalidConfigurationValueException(GetType(), method, "percentage", currentPercentage / 100);
            }
            if (runnableProfiles == 0)
            {
                throw new InvalidConfigurationValueException(GetType(), method, "enabled", false);
            }

            _thread = new Thread(Run);
        }
コード例 #7
0
 public void SetDefaultSink(IChannelSink sink)
 {
     _sink = sink.Required(nameof(sink));
     StopAllChannelSinks();
 }
コード例 #8
0
        public IActiveChannel AllocateChannel(IChannelSink channelSink)
        {
            var channel = (ulong)Interlocked.Increment(ref _lastChannelUsed);

            return(_channelSinks[channel] = new ActiveChannel(channel, channelSink, this));
        }
コード例 #9
0
 public void Open(object sinkInfo, IChannelSink nextSink)
 {
 }
コード例 #10
0
 /// <summary>
 /// 指定した出力ストリームを出力ストリームリストから削除します
 /// </summary>
 /// <param name="stream">削除する出力ストリーム</param>
 public void RemoveOutputStream(IChannelSink stream)
 {
     ReplaceCollection(ref sinks, old => old.Remove(stream));
 }
コード例 #11
0
 public OutputChannelConnectionViewModel(IChannelSink os)
 {
     outputStream = os;
 }
コード例 #12
0
 internal ActiveChannel(ulong channel, IChannelSink sink, ConnectionBase peerConnection)
 {
     Channel        = channel;
     PeerConnection = peerConnection.Required(nameof(peerConnection));
     Sink           = sink.Required(nameof(sink));
 }