예제 #1
0
 public int GetIntFromStream(Stream stream)
 {
     Interlocked.Increment(ref s_getIntFromStreamCallbacks);
     // we don't know the stream size
     // If we care much about the buffer size it should go to IDuplexStreamingTestParams
     return(VerifiableStream.VerifyStream(stream, -1, 4096, _verifyContent));
 }
예제 #2
0
 private void TestGetStreamFromInt(StreamingService channel, int requestedStreamSize, int bufSize)
 {
     using (var stream = channel.GetStreamFromInt(requestedStreamSize))
     {
         var receivedStreamSize = VerifiableStream.VerifyStream(stream, requestedStreamSize, bufSize, _params.VerifyStreamContent);
         if (receivedStreamSize != requestedStreamSize)
         {
             VerifiableStream.ReportIncorrectStreamSize(receivedStreamSize, requestedStreamSize);
         }
     }
 }
예제 #3
0
 private async Task TestGetStreamFromIntAsync(StreamingService channel, int requestedStreamSize, int bufSize)
 {
     using (var stream = await channel.GetStreamFromIntAsync(requestedStreamSize))
     {
         var receivedStreamSize = VerifiableStream.VerifyStream(stream, requestedStreamSize, bufSize);
         if (receivedStreamSize != requestedStreamSize)
         {
             VerifiableStream.ReportIncorrectStreamSize(receivedStreamSize, requestedStreamSize);
         }
     }
 }
예제 #4
0
        private static int TestGetStreamFromInt(StreamingRequestContext <StreamingService> details)
        {
            details.TestScenario = StreamingScenarios.StreamIn;
            bool verifyStreamContent = details.VerifyStreamContent;

            using (var stream = details.Channel.GetStreamFromInt(details.StreamSize))
            {
                var receivedStreamSize = VerifiableStream.VerifyStream(stream, details.StreamSize, details.BufferSize, verifyStreamContent);
                if (receivedStreamSize != details.StreamSize)
                {
                    VerifiableStream.ReportIncorrectStreamSize(receivedStreamSize, details.StreamSize);
                }
            }
            return(1);
        }
예제 #5
0
        private void TestEchoStream(StreamingService channel, int requestedStreamSize, int bufSize)
        {
            using (var stream = new VerifiableStream(requestedStreamSize))
            {
                using (var receivedStream = channel.EchoStream(stream))
                {
                    var receivedSize = VerifiableStream.VerifyStream(receivedStream, requestedStreamSize, bufSize);

                    if (receivedSize != requestedStreamSize)
                    {
                        VerifiableStream.ReportIncorrectStreamSize(receivedSize, requestedStreamSize);
                    }
                }
            }
        }
예제 #6
0
        private static int TestEchoStream(StreamingRequestContext <StreamingService> details)
        {
            details.TestScenario = StreamingScenarios.StreamEcho;
            using (var stream = new VerifiableStream(details.StreamSize))
            {
                using (var receivedStream = details.Channel.EchoStream(stream))
                {
                    var receivedSize = VerifiableStream.VerifyStream(receivedStream, details.StreamSize, details.BufferSize, details.VerifyStreamContent);

                    if (receivedSize != details.StreamSize)
                    {
                        VerifiableStream.ReportIncorrectStreamSize(receivedSize, details.StreamSize);
                    }
                }
            }
            return(1);
        }
예제 #7
0
 public int GetIntFromStream(Stream stream)
 {
     // we don't know the stream size
     // If we care much about the buffer size it should go to IDuplexStreamingTestParams
     return(VerifiableStream.VerifyStream(stream, -1, 4096));
 }