Skip to content

Instantly share code, notes, and snippets.

@iluxonchik
Created July 3, 2015 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iluxonchik/23585388ce3f62b643e6 to your computer and use it in GitHub Desktop.
Save iluxonchik/23585388ce3f62b643e6 to your computer and use it in GitHub Desktop.
private static void run()
{
ProcessStartInfo pstartInfo = new ProcessStartInfo();
pstartInfo.FileName = @"C:\Program Files (x86)\Livestreamer\livestreamer.exe";
pstartInfo.Arguments = "rtmp://eumedia1.livecoding.tv:1935/livecodingtv/kitty_cent?t=6812FAC8CF464F2D8340D7FCA92AA033 worst --stdout --stream-timeout 120";
pstartInfo.UseShellExecute = false;
pstartInfo.RedirectStandardOutput = true;
Process p = new Process();
p.StartInfo = pstartInfo;
Task[] taskArr = new Task[1000];
for (int i = 0; i < 1000; i++)
{
taskArr[i] = Task.Factory.StartNew(() =>
{
// p.OutputDataReceived += new DataReceivedEventHandler(P_OutputDataReceived);
p.Start();
//p.BeginOutputReadLine();
p.WaitForExit();
Console.WriteLine("Exiting...");
});
Console.WriteLine("Deployed task {0}", i);
}
Task.WaitAll(taskArr);
// Console.WriteLine(p.StandardOutput.ReadToEnd());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment