Exemplo n.º 1
0
        internal async Task Connect(ConnectionInfo connectionInfo, Session session, ILogger logger)
        {
            var address = connectionInfo.Network == "unix"
                ? $"unix://{connectionInfo.Address}"
                : connectionInfo.Address;

            var channel = new Channel(address, ChannelCredentials.Insecure);
            await channel.ConnectAsync();

            var interceptedChannel = channel.Intercept(new ExceptionLoggingInterceptor(logger));

            Console.Error.WriteLine("[DEBUG] GRPC Channel Connected");
            Whisper    = new WhisperClient(interceptedChannel, session, logger);
            Clipboard  = new ClipboardClient(interceptedChannel, session, logger);
            Filesystem = new FilesystemClient(interceptedChannel, session, logger);
            Cursor     = new CursorClient(interceptedChannel, session, logger);
            Keyboard   = new KeyboardClient(interceptedChannel, session, logger);
            Network    = new NetworkClient(interceptedChannel, session, logger);
            Process    = new ProcessClient(interceptedChannel, session, logger);
            Browser    = new BrowserClient(interceptedChannel, session, logger);
            Hover      = new HoverClient(interceptedChannel, session, logger);
            Window     = new WindowClient(interceptedChannel, session, logger);
            Storage    = new StorageClient(interceptedChannel, session, logger);
            UI         = new UIClient(interceptedChannel, session, logger);
        }
Exemplo n.º 2
0
 public NetRoomReader()
 {
     foodObjectReader        = new ProcessFood();
     drinkObjectReader       = new ProcessDrink();
     cardObjectReader        = new ProcessCard();
     categoryObjectReader    = new ProcessCategory();
     clientObjectReader      = new ProcessClient();
     memberObjectReader      = new ProcessMember();
     groupClientObjectReader = new ProcessGroupClient();
     groupUserObjectReader   = new ProcessGroupUser();
     userObjectReader        = new ProcessUser();
     billObjectReader        = new ProcessBill();
 }
Exemplo n.º 3
0
        public void Connect()
        {
            try
            {
                c = new Connection();
                while (true)
                {
                    c.Connect();
                    if (c.State())
                    {
                        c.Send("Enviando Procesos");
                        c.Listen();
                        ProcessClient process          = new ProcessClient();
                        System.Diagnostics.Process[] p = process.ListAllApplications();

                        foreach (Process theprocess in p)
                        {
                            //c.Send(theprocess.ProcessName+" "+theprocess.Id);
                            c.Send(theprocess.ProcessName);
                            c.Listen();
                        }
                        c.Send("FIN");



                        while (true)
                        {
                            string input = c.Listen();

                            if (input == "FIN")
                            {
                                break;
                            }
                            else
                            {
                                process.killProcess(input);
                            }
                        }
                    }
                    else
                    {
                        Thread.Sleep(10000);
                    }
                }
            }
            catch (Exception e)
            {
                //Debug.Print(e.ToString());
            }
        }
Exemplo n.º 4
0
        private void OnAccept(IAsyncResult ar)
        {
            try
            {
                TcpClient socket = m_listener.EndAcceptTcpClient(ar);
                socket.SendTimeout       = 3000;
                socket.ReceiveTimeout    = 3000;
                socket.SendBufferSize    = 64 * 1024;
                socket.ReceiveBufferSize = 64 * 1024;
                socket.NoDelay           = true;
                if (m_shuttingDown)
                {
                    m_shutdownCompleted.Set();
                    return;
                }

                ProcessClient.AcceptAsync(this, socket);
                m_listener.BeginAcceptTcpClient(m_onAccept, null);
            }
            catch (ObjectDisposedException)
            {
                if (m_shuttingDown)
                {
                    m_shutdownCompleted.Set();
                    return;
                }
            }
            catch (Exception er)
            {
                if (m_shuttingDown)
                {
                    m_shutdownCompleted.Set();
                    return;
                }
                Logger.SwallowException(er, "Exception while processing a client's accept, restarting the OnAccept");
                try
                {
                    m_listener.BeginAcceptTcpClient(m_onAccept, null);
                }
                catch (Exception e)
                {
                    m_shutdownCompleted.Set();
                    Logger.SwallowException(e, "Exception while attempting to restart the OnAccept");
                }
            }
        }
Exemplo n.º 5
0
        private static ProcessClient NewProcess(string name)
        {
            Process pipeClient = new Process();
            pipeClient.StartInfo.FileName = "StartStopProcessClient.exe";

            NamedPipeServerStream pipeServer = new NamedPipeServerStream(name, PipeDirection.Out);
            pipeClient.StartInfo.Arguments = name;
            pipeClient.StartInfo.UseShellExecute = false;
            pipeClient.Start();

            pipeServer.WaitForConnection();

            StreamWriter sw = new StreamWriter(pipeServer);
            sw.AutoFlush = true;

            ProcessClient pc = new ProcessClient { Process = pipeClient, PipeStream = pipeServer, Sw = sw };
            SendMessage(pc, name);
            return pc;
        }
Exemplo n.º 6
0
        private static void CloseProcess(ProcessClient pc)
        {
            SendMessage(pc, "STOP");
            pc.PipeStream.WaitForPipeDrain();
            pc.Process.WaitForExit();

            if (pc.Sw != null)
            {
                pc.Sw.Close();
                pc.Sw.Dispose();
            }
            if (pc.PipeStream != null)
            {
                pc.PipeStream.Close();
                pc.PipeStream.Dispose();
            }

            pc.Process.Close();
        }
Exemplo n.º 7
0
        public void Stop()
        {
            if (m_Client != null)
            {
                if (m_Client.Connected)
                {
                    m_Client.Shutdown(SocketShutdown.Both);
                    m_Client.Disconnect(false);
                }

                m_Client = null;
            }

            if (ProcessClient != null)
            {
                ProcessClient.Abort();
                ProcessClient = null;
            }

            GC.Collect();
        }
Exemplo n.º 8
0
 protected DomainContextBase()
 {
     Process = new ProcessClient(this);
 }
Exemplo n.º 9
0
 private static void SendMessage(ProcessClient pc, string message)
 {
     pc.Sw.WriteLine(message);
     LogItLine(message);
 }
Exemplo n.º 10
0
 public ProcessService(ProcessClient processClient)
 {
     this.ProcessClient = processClient;
 }
Exemplo n.º 11
0
 public ProcessService()
 {
     this.ProcessClient = new ProcessClient();
 }
Exemplo n.º 12
0
        public static void Start()
        {
            if (started)
            {
                return;
            }

            started = true;

            Navigator.Start(new NavigationManager(multithreaded: true));
            Finder.Start(new FinderManager());
            Constructor.Start(new ConstructorManager());

            OperationClient.Start(new OperationManager());

            AuthClient.Start(
                types: true,
                property: true,
                queries: true,
                permissions: true,
                operations: true,
                defaultPasswordExpiresLogic: false);

            Navigator.EntitySettings <UserEntity>().OverrideView += (usr, ctrl) =>
            {
                ctrl.Child <EntityLine>("Role").After(new ValueLine().Set(Common.RouteProperty, "[UserEmployeeMixin].AllowLogin"));
                ctrl.Child <EntityLine>("Role").After(new EntityLine().Set(Common.RouteProperty, "[UserEmployeeMixin].Employee"));

                return(ctrl);
            };

            LinksClient.Start(widget: true, contextualMenu: true);

            ProcessClient.Start(package: true, packageOperation: true);
            SchedulerClient.Start();

            FilePathClient.Start();
            ExcelClient.Start(toExcel: true, excelReport: false);
            UserQueryClient.Start();
            ChartClient.Start();
            DashboardClient.Start();

            HelpClient.Start();

            ExceptionClient.Start();

            NoteClient.Start(typeof(UserEntity), /*Note*/ typeof(OrderEntity));
            AlertClient.Start(typeof(UserEntity), /*Alert*/ typeof(OrderEntity));
            SMSClient.Start();

            ProfilerClient.Start();

            OmniboxClient.Start();
            OmniboxClient.Register(new SpecialOmniboxProvider());
            OmniboxClient.Register(new EntityOmniboxProvider());
            OmniboxClient.Register(new DynamicQueryOmniboxProvider());
            OmniboxClient.Register(new UserQueryOmniboxProvider());
            OmniboxClient.Register(new ChartOmniboxProvider());
            OmniboxClient.Register(new UserChartOmniboxProvider());
            OmniboxClient.Register(new DashboardOmniboxProvider());

            SouthwindClient.Start();

            DisconnectedClient.Start();

            Navigator.Initialize();
        }
Exemplo n.º 13
0
 public EduGeraHorarioTurmaData(ProcessClient processClient)
     : base(processClient, nameof(EduGeraHorarioTurmaData))
 {
 }
Exemplo n.º 14
0
 public EduGeraPlanoAulaData(ProcessClient processClient)
     : base(processClient, nameof(EduGeraPlanoAulaData))
 {
 }
            public static void AcceptAsync(CtpServer server, TcpClient client)
            {
                var pc = new ProcessClient(server, client);

                pc.Start();
            }
Exemplo n.º 16
0
        private void WebStart()
        {
            Navigator.Start(new NavigationManager("haradwaithwinds"));
            Finder.Start(new FinderManager());
            Constructor.Start(new ConstructorManager(), new ClientConstructorManager());

            OperationClient.Start(new OperationManager(), true);

            AuthClient.Start(
                types: true,
                property: true,
                queries: true,
                resetPassword: true,
                passwordExpiration: false,
                singleSignOnMessage: false);

            Navigator.EntitySettings <UserEntity>().CreateViewOverrides()
            .AfterLine((UserEntity u) => u.Role, (html, tc) => html.ValueLine(tc, u => u.Mixin <UserEmployeeMixin>().AllowLogin))
            .AfterLine((UserEntity u) => u.Role, (html, tc) => html.EntityLine(tc, u => u.Mixin <UserEmployeeMixin>().Employee));

            AuthAdminClient.Start(
                types: true,
                properties: true,
                queries: true,
                operations: true,
                permissions: true);

            MailingClient.Start(
                smtpConfig: true,
                newsletter: false,
                pop3Config: false,
                emailReport: false,
                quickLinkFrom: null);

            SMSClient.Start();

            SessionLogClient.Start();
            ExceptionClient.Start();
            UserQueriesClient.Start();
            FilesClient.Start(
                file: true,
                embeddedFile: true,
                filePath: false,
                embeddedFilePath: true);

            MapClient.Start();
            ChartClient.Start();
            ExcelClient.Start(
                toExcelPlain:  true,
                excelReport: false,
                excelAttachment: false);

            WordClient.Start();
            DashboardClient.Start();

            DisconnectedClient.Start();
            ProcessClient.Start(
                packages: true,
                packageOperations: true);

            TranslationClient.Start(new AlreadyTranslatedTranslator(new BingTranslator()),
                                    translatorUser: true,
                                    translationReplacement: false,
                                    instanceTranslator: true);

            SchedulerClient.Start(simpleTask: true);

            NoteClient.Start(typeof(UserEntity), /*Note*/ typeof(OrderEntity));
            AlertClient.Start(typeof(UserEntity), /*Alert*/ typeof(OrderEntity));
            LinksClient.Start(widget: true, contextualItems: true);

            ViewLogClient.Start();
            DiffLogClient.Start();

            HelpClient.Start("Images", "http://localhost:7654/");

            SouthwindClient.Start();

            CacheClient.Start();

            ProfilerClient.Start();

            ScriptHtmlHelper.Manager.MainAssembly = typeof(SouthwindClient).Assembly;
            SignumControllerFactory.MainAssembly  = typeof(SouthwindClient).Assembly;
            SignumControllerFactory.EveryController().AddFilters(ctx =>
                                                                 ctx.FilterInfo.AuthorizationFilters.OfType <AuthenticationRequiredAttribute>().Any() ? null : new AuthenticationRequiredAttribute());
            SignumControllerFactory.EveryController().AddFilters(new SignumExceptionHandlerAttribute());
            SignumControllerFactory.EveryController().AddFilters(new ProfilerFilterAttribute());
            SignumControllerFactory.RegisterAvoidValidate();

            Navigator.Initialize();

            OmniboxClient.Start();
            OmniboxClient.Register(new SpecialOmniboxProvider());
            OmniboxClient.Register(new EntityOmniboxProvider());
            OmniboxClient.Register(new DynamicQueryOmniboxProvider());
            OmniboxClient.Register(new UserQueryOmniboxProvider());
            OmniboxClient.Register(new ChartOmniboxProvider());
            OmniboxClient.Register(new UserChartOmniboxProvider());
            OmniboxClient.Register(new DashboardOmniboxProvider());
            OmniboxClient.Register(new HelpOmniboxProvider());
            OmniboxClient.Register(new MapOmniboxProvider());
        } //WebStart