예제 #1
0
        public static void ProcessStdInAgent(string Data)
        {
            Push_Stdio_StdIn pdata = null;
            StdIORedir       redir = null;

            try
            {
                pdata = JsonConvert.DeserializeObject <Push_Stdio_StdIn>(Data);
            }
            catch (Exception ee)
            {
                Debug.WriteLine(ee.ToString());
            }

            if (pdata == null)
            {
                return;
            }

            lock (Locker)
            {
                if (Redirs.ContainsKey(pdata.SessionID) == false)
                {
                    return;
                }
                redir = Redirs[pdata.SessionID];
            }

            redir.PushStdinFromAgent(pdata);
        }
예제 #2
0
        public static string StartRedir(string Filename, string Args, Network net)
        {
            string     SessionID = Guid.NewGuid().ToString();
            StdIORedir R         = new StdIORedir(Filename, Args, SessionID, net.CloneElement());

            lock (Locker)
            {
                Redirs.Add(SessionID, R);
            }

            return(SessionID);
        }
예제 #3
0
        public static void RunPipeConsoleEnd(Process2ProcessComm resp2p, DataHRunConredir R)
        {
            Process2ProcessComm todop2p = new Process2ProcessComm();

            if (todop2p.ConnectPipe(R.TODOPipeGUID) == false)
            {
                Debug.WriteLine("Cannot get 2nd Pipe");
                return;
            }

            StdIORedir rr = new StdIORedir(todop2p, resp2p, R);

            rr.RunConsoleEnd();
        }