Created
July 3, 2015 20:16
-
-
Save iluxonchik/23585388ce3f62b643e6 to your computer and use it in GitHub Desktop.
This file contains 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
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