Exemple #1
0
        static int Main(string[] args)
        {
            ShellSocket SS;

#if !(NETSTANDARD2_0 || NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2)
            if (IsOSPlatform(OSPlatform.Linux) || IsOSPlatform(OSPlatform.FreeBSD) || IsOSPlatform(OSPlatform.OSX))
#else
            if (IsOSPlatform(OSPlatform.Linux) || IsOSPlatform(OSPlatform.OSX))
#endif
            { SS = new ShellSocket("bash -c \"yes hi 1>&2\"", "hi"); }
            else
            {
                SS = new ShellSocket("cmd", " /c \"echo hi 1>&2\"");
            }
            System.Console.WriteLine("Starting...");
            SS.RedirectErrorsToConsole = true;
            SS.Start();
            Stream S = SS.GetStream();
            System.Console.WriteLine("ShellSocket created...");
            pair P = new pair(new StreamReader(Console.OpenStandardInput()), new StreamWriter(Console.OpenStandardOutput()));
            System.Console.WriteLine("Pair created...");
            System.Console.WriteLine("{0}", new StreamWriter(Console.OpenStandardOutput()));
            System.Console.WriteLine("Binding...");
            System.Console.WriteLine("P:{0} S:{1}", P, S);
            Rishi.PairStream.pair.BindStreams(P, S);
            return(0);
        }