Skip to content

Commit 22d17b0

Browse files
authored
Fix (Http)WebRequest (Begin|End)GetResponse samples (#11030)
These samples were not handling the `asyncResult.CompletedSynchronously == true` case correctly: changing the sample code to use smaller buffer leads to stack overflow because of recursion on synchronous completions. Besides the fix there the PR adds some consolidation: - Cleanup and (somewhat) modernize the sample code - Remove the Timer-based custom timeout implementation, use `WebRequest.Timeout` instead - Collapse various samples into one sample - Unifiy the `HttpWebRequest` and `WebRequest` samples since they are practically identical - Delete CPP and VB samples given we don't have the capacity and the intention to maintain them.
1 parent f9285cf commit 22d17b0

File tree

12 files changed

+159
-1101
lines changed

12 files changed

+159
-1101
lines changed

snippets/cpp/VS_Snippets_Remoting/System.Net.HttpWebRequest.BeginGetResponse/CPP/begingetresponse.cpp

-195
This file was deleted.

snippets/cpp/VS_Snippets_Remoting/WebRequest_BeginGetResponse/CPP/webrequest_begingetresponse.cpp

-173
This file was deleted.

snippets/csharp/System.Net/HttpWebRequest/Abort/Project.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<OutputType>Library</OutputType>
4+
<OutputType>Exe</OutputType>
55
<TargetFramework>net6.0</TargetFramework>
66
</PropertyGroup>
77

0 commit comments

Comments
 (0)