public void StartProfiling(int profiledProcessId, Guid agentApplicationUid) { //Profiling is already started or decoding in progress if (_profiledProcess != null) { return; } DirectoryInfo profilingResultsDirectory = _application.ApplicationSettings.ProfilingResults.GetDirectory(); string profilingResultsFile = Path.Combine(profilingResultsDirectory.FullName, _application.Uid.ToString("N")); _storage = new DataStorage(profilingResultsFile); _profiledProcess = new ProfiledProcessManager(profiledProcessId); _profiledProcess.Exited += OnProfiledProcessExited; ProcessInformation = _profiledProcess.GetProcessInformation(); IStreamFactory streamFactory = Connector.Native.StreamFactory; _requestServer = new RequestServer(); _requestServer.Run(streamFactory.CreateInvokeStream()); _gatewayServer = new NativeGatewayServer(_agentLibrary, Connector.ApplicationUid, _application.ConfigurationSettings.GatewaySettings); //new ManagedGatewayServer(streamFactory, _application.Settings.GatewaySettings);// _agentClient = new RequestClient(streamFactory.OpenInvokeStream(agentApplicationUid)); ConfigurationSettings configurationSettings = _application.ConfigurationSettings; ProfilingTypeSettingsCollection profilingTypesSettings = configurationSettings.ProfilingTypesSettings; _profilingTypesManager = new ProfilingTypeManager(_profilingTypes, profilingTypesSettings); _profilingTypesManager.AttachStorage(_storage); _profilingTypesManager.ExportServices(_application.ServiceContainer); _profilingTypesManager.ImportServices(_application.ServiceContainer); _profilingTypesManager.StartProfiling(_gatewayServer); _gatewayServer.Lock(); _gatewayServer.Start(); _application.RaiseSessionStateChanged(); }
public static void InitLayerServer() { Info = new InfoServer(); Info.Init(); Request = new RequestServer(); Request.Init(); Behavior = new BehaviorServer(); Behavior.Init(); }
// Use this for initialization void Start() { foreach (QuizView view in quizViews) { view.HideNoAnimate(); } this.questions = RequestServer.GetQuestions(); NextQuestion(); }
public async void Run(IBackgroundTaskInstance taskInstance) { deferral = taskInstance.GetDeferral(); HardwareDispatcher hardwareDispatcher = new HardwareDispatcher(GpioController.GetDefault()); RepositoryDispatcher repositoryDispatcher = new RepositoryDispatcher(); RequestServer hardwareServer = new RequestServer(SettingsManager.Instance.HardwareServerPort, hardwareDispatcher); RequestServer repositoryServer = new RequestServer(SettingsManager.Instance.RepositoryServerPort, repositoryDispatcher); await hardwareServer.StartAsync(); await repositoryServer.StartAsync(); }
public void RequestData(DataType type, Action <bool, string> callback) { _callback = callback; switch (type) { case DataType.Plaza: StartCoroutine(RequestServer.DownLoad(PLAZA_PATH, ReceiveData)); break; case DataType.Compete: StartCoroutine(RequestServer.DownLoad(COMPETE_PATH, ReceiveData)); break; case DataType.Job: StartCoroutine(RequestServer.DownLoad(JOB_PAHT, ReceiveData)); break; } }
protected override void RunInternal() { _frameworks = new FrameworkCollection(Catalog.Frameworks, ExportLoader); _profilingTypes = new ProfilingTypeCollection(Catalog.ProfilingTypes, ExportLoader); _profilingTargets = new ProfilingTargetCollection(Catalog.ProfilingTargets, ExportLoader); _configurations = new ConfigurationCollection(_profilingTargets, _frameworks, this); _sessions = new SessionCollection(this); _requestServer = new RequestServer(); _requestServer.RegisterHandler(new StartProfilingSessionRequestHandler( _configurations, _sessions, _frameworks, _profilingTypes, _profilingTargets)); //TODO: Host must listen all possible types of streams (NamePipes, SharedMemory, RPC) _ //TODO: _ because agents may use different transports, depending on apps they profile IServerStream serverStream = Connector.Native.StreamFactory.CreateInvokeStream(); _requestServer.Run(serverStream); ServiceContainer.Register(new Remote.IO.FileSystemAccessor(true)); }
public static void Start() { TcpListener server = null; TcpClient client = null; string ipAddress = ConfigServer.IP_ADDRESS; int port = Int32.Parse(ConfigServer.PORT); int limitClients = Int32.Parse(ConfigServer.LISTENERS); Byte[] bytes = new Byte[1024]; try { server = StartListener.Start(ipAddress, port, limitClients); Console.Clear(); Console.WriteLine($"Server start in:\nIP: {ipAddress}\nPORT: {port}\nCLIENTS LIMIT: {limitClients}"); while (true) { Console.WriteLine("\nWaiting for Client Request..."); client = server.AcceptTcpClient(); NetworkStream stream = client.GetStream(); int i; while ((i = stream.Read(bytes, 0, bytes.Length)) != 0) { string req = RequestServer.GetRequest(stream, bytes, i); ResponseManager.GetResponse(stream, req); } } } catch (Exception ex) { Console.WriteLine($"Exception: {ex.Message}"); } client.Close(); server.Stop(); Console.WriteLine("\nPress any key to continue..."); Console.ReadKey(true); }
public void RequestImageData(int id, string path, Action <int, Sprite> final) { StartCoroutine(RequestServer.GetImage(id, path, final, ReceiveImageData)); }
public Main() { InitializeComponent(); server = new RequestServer(); Timer.Start(); }