public DeployService(ServerContent server) { this.server = server; appName = MposFramework.Instance.DeviceController.AppName; appVersion = MposFramework.Instance.DeviceController.Version; }
public DiscoveryService(ServerContent server) { this.server = server; servicePort = 30015; appName = MposFramework.Instance.DeviceController.AppName; appVersion = MposFramework.Instance.DeviceController.Version; }
public DiscoveryService(ServerContent server) { this.server = server; servicePort = 30015; appName = MposFramework.Instance.DeviceController.AppName; appVersion = MposFramework.Instance.DeviceController.Version; }
public ProfileNetworkTask(ServerContent server, string startMessage) { this.server = server; this.startMessage = startMessage; network = new Network(); watch = new Stopwatch(); hostName = new HostName(server.Ip.ToString()); }
private object InvokeRemotable(ServerContent server, bool needProfile, MethodInfo method, object[] methodParams) { rpc.SetupServer(server); object returnMethod = rpc.Call(needProfile, manualSerialization, objOriginal, method.Name, methodParams); if (needProfile) { var profile = rpc.Profile; //Debug.WriteLine("[DEBUG]: Results -> " + profile.ToString()); EndpointController.rpcProfile = profile; } if (returnMethod != null) { return(returnMethod); } else { throw new RpcException("Method (failed): " + method.Name + ", return 'null' value from remotable method"); } }
private void ExecutionCompleted(Network network) { if (network != null) { network.GeneratingPingTcpStats(); Debug.WriteLine("[DecisionMaker]: -> Ping max: " + network.PingMaxTCP + ", med: " + network.PingMedTCP + ", min: " + network.PingMinTCP); MposFramework.Instance.EndpointController.RemoteAdvantage = network.PingMedTCP < PingTolerance; //List<Network> lists = profileDao.Last15Results(); //System.Diagnostics.Debug.WriteLine("[DEBUG]: Network Results!!!"); //foreach (Network net in lists) //{ // System.Diagnostics.Debug.WriteLine(net); //} } else { Server = null; MposFramework.Instance.EndpointController.RemoteAdvantage = false; Debug.WriteLine("[DecisionMaker]: Any problem in ping test!"); } }
public void NetworkAnalysis(ServerContent server, ProfileNetwork profile) { if (server == null) { throw new NetworkException("The remote service isn't ready for profile network"); } if (profile == ProfileNetwork.LIGHT) { taskNetwork = new ProfileNetworkLight(server); } else if (profile == ProfileNetwork.DEFAULT) { taskNetwork = new ProfileNetworkDefault(server); } else if (profile == ProfileNetwork.FULL) { taskNetwork = new ProfileNetworkFull(server); } EventIntercept(); taskNetwork.Execute(); }
public void NetworkAnalysis(ServerContent server) { NetworkAnalysis(server, profileNetwork); }
public void SetupServer(ServerContent server) { this.server = server; }
public RpcClient() { profile = new RpcProfile(); this.server = null; }
private byte[] data; //used on uploading... public ProfileNetworkFull(ServerContent server) : base(server, "ProfileFull Started on endpoint: " + server.Ip) { data = new byte[32 * 1024]; new Random().NextBytes(data); }
public DynamicDecisionSystem(ServerContent server) { Server = server; profileDao = new ProfileNetworkDao(); }
public ProfileNetworkLight(ServerContent server) : base(server, "ProfileLight Started on endpoint: " + server.Ip) { }
public void AddContent(string path, string content) { var contentDto = new ServerContent(path, content); _content[contentDto.Path] = contentDto; }
public ProfileNetworkDefault(ServerContent server) : base(server, "ProfileDefault Started on endpoint: " + server.Ip) { }
public object Invoke(object original, MethodInfo method, object[] methodAttributes, object[] methodParams) { foreach (object remotableAttribute in methodAttributes) { if (remotableAttribute is Remotable) { //Debug.WriteLine(">> ProxyHandler '" + proxy.GetType().Name + "' call Remotable method: " + method + " with params: " + methodParams); Remotable remotable = remotableAttribute as Remotable; ServerContent server = MposFramework.Instance.EndpointController.SelectPriorityServer(remotable.CloudletPriority); if (remotable.Type == Offload.STATIC) { if (server != null) { try { return(InvokeRemotable(server, remotable.Status, method, methodParams)); } catch (ConnectException e) { Debug.WriteLine("[DEBUG]: " + e.Message); MposFramework.Instance.EndpointController.RediscoveryServices(server); } catch (Exception e) { Debug.WriteLine("[DEBUG]: " + e.Message); } } } else { try { if (server != null) { MposFramework.Instance.EndpointController.UpdateDynamicDecisionSystemEndpoint(server); if (MposFramework.Instance.EndpointController.RemoteAdvantage) { return(InvokeRemotable(server, remotable.Status, method, methodParams)); } } } catch (ConnectException e) { Debug.WriteLine("[DEBUG]: " + e.Message); MposFramework.Instance.EndpointController.RediscoveryServices(server); //cloudlet fails try using the internet service if (server.Type == EndpointType.CLOUDLET) { try { //NOTICE: only on real device, can check connection, however use this line //server = MposFramework.Instance.EndpointController.InternetServer; server = MposFramework.Instance.EndpointController.CheckSecondaryServer(); if (server != null) { return(InvokeRemotable(server, remotable.Status, method, methodParams)); } } catch (ConnectException eIntern) { Debug.WriteLine("[DEBUG]: Inner try -> " + eIntern.Message); MposFramework.Instance.EndpointController.RediscoveryServices(server); } catch (Exception eIntern) { Debug.WriteLine("[DEBUG]: Inner try -> " + eIntern.Message); } } } catch (Exception e) { Debug.WriteLine("[DEBUG]: " + e.Message); } } if (remotable.Status) { watch.Reset(); watch.Start(); object objReturn = method.Invoke(objOriginal, methodParams); watch.Stop(); EndpointController.rpcProfile.ExecutionCpuTime = watch.ElapsedMilliseconds; //Debug.WriteLine("[DEBUG]: Results -> " + EndpointController.rpcProfile.ToString()); return(objReturn); } } } //Debug.WriteLine("#> ProxyHandler '" + proxy.GetType().Name + "' call Local method: " + method + " with params: " + methodParams); return(method.Invoke(objOriginal, methodParams)); }