/// <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 }); }
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(); }
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(); }
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); }
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); }
public void SetDefaultSink(IChannelSink sink) { _sink = sink.Required(nameof(sink)); StopAllChannelSinks(); }
public IActiveChannel AllocateChannel(IChannelSink channelSink) { var channel = (ulong)Interlocked.Increment(ref _lastChannelUsed); return(_channelSinks[channel] = new ActiveChannel(channel, channelSink, this)); }
public void Open(object sinkInfo, IChannelSink nextSink) { }
/// <summary> /// 指定した出力ストリームを出力ストリームリストから削除します /// </summary> /// <param name="stream">削除する出力ストリーム</param> public void RemoveOutputStream(IChannelSink stream) { ReplaceCollection(ref sinks, old => old.Remove(stream)); }
public OutputChannelConnectionViewModel(IChannelSink os) { outputStream = os; }
internal ActiveChannel(ulong channel, IChannelSink sink, ConnectionBase peerConnection) { Channel = channel; PeerConnection = peerConnection.Required(nameof(peerConnection)); Sink = sink.Required(nameof(sink)); }