Created
April 8, 2010 20:22
-
-
Save statianzo/360495 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
using System.Threading; | |
internal class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
Random random = new Random(); | |
for (int i = 0; i < 25; i++) | |
{ | |
ThreadPool.QueueUserWorkItem(x => | |
{ | |
while (true) | |
{ | |
WebRequest webRequest = | |
WebRequest.Create("http://localhost:43157/FileProvider/GetFile?fileName=FileName" + random.Next(1000)); | |
var response = webRequest.GetResponse() as HttpWebResponse; | |
if ((int)response.StatusCode > 200) | |
throw new Exception("Bad news here"); | |
Console.WriteLine(response.StatusCode); | |
} | |
}); | |
} | |
Console.ReadLine(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment