A class used to test opening and closing a TCP socket.
示例#1
0
        /// <summary>
        /// Shows a sample loop where an action is executed, and the latency of each execution is recorded.
        /// </summary>
        private void RecordMeasurements(IRecorder recorder)
        {
            var    sut             = new SocketTester("google.com");
            Action actionToMeasure = sut.CreateAndCloseDatagramSocket;
            var    timer           = Stopwatch.StartNew();

            do
            {
                recorder.Record(actionToMeasure);
            } while (timer.Elapsed < RunPeriod);
            Interlocked.Increment(ref _isCompleted);
        }
 /// <summary>
 /// Shows a sample loop where an action is executed, and the latency of each execution is recorded.
 /// </summary>
 private void RecordMeasurements(IRecorder recorder)
 {
     var sut = new SocketTester("google.com");
     Action actionToMeasure = sut.CreateAndCloseDatagramSocket;
     var timer = Stopwatch.StartNew();
     do
     {
         recorder.Record(actionToMeasure);
     } while (timer.Elapsed < RunPeriod);
     Interlocked.Increment(ref _isCompleted);
 }