/// <summary>Snippet for MethodServerStreaming</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task MethodServerStreamingRequestObject() { // Create client SnippetsClient snippetsClient = SnippetsClient.Create(); // Initialize request argument(s) SignatureRequest request = new SignatureRequest { AString = "", AnInt = 0, ABool = false, MapIntString = { { 0, "" }, }, }; // Make the request, returning a streaming response SnippetsClient.MethodServerStreamingStream response = snippetsClient.MethodServerStreaming(request); // Read streaming responses from server until complete // Note that C# 8 code can use await foreach AsyncResponseStream <Response> responseStream = response.GetResponseStream(); while (await responseStream.MoveNextAsync()) { Response responseItem = responseStream.Current; // Do something with streamed response } // The response stream has completed }
/// <summary>Snippet for MethodServerStreaming</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task MethodServerStreaming2() { // Create client SnippetsClient snippetsClient = SnippetsClient.Create(); // Make the request, returning a streaming response SnippetsClient.MethodServerStreamingStream response = snippetsClient.MethodServerStreaming(); // Read streaming responses from server until complete // Note that C# 8 code can use await foreach AsyncResponseStream <Response> responseStream = response.GetResponseStream(); while (await responseStream.MoveNextAsync()) { Response responseItem = responseStream.Current; // Do something with streamed response } // The response stream has completed }