public ServerContent SelectPriorityServer(bool cloudletPriority) { if (cloudletPriority) { ServerContent server = CheckCloudletServer(); if (server != null) { return(server); } server = CheckSecondaryServer(); if (server != null) { return(server); } } else { ServerContent server = CheckSecondaryServer(); if (server != null) { return(server); } server = CheckCloudletServer(); if (server != null) { return(server); } } return(null); }
public DeployService(ServerContent server) { this.server = server; appName = MposFramework.Instance.DeviceController.AppName; appVersion = MposFramework.Instance.DeviceController.Version; }
public void StartDecisionMaker(ServerContent server) { lock (mutex) { if (dynamicDecisionSystem == null && decisionMakerActive) { dynamicDecisionSystem = new DynamicDecisionSystem(server); dynamicDecisionSystem.Start(); } } }
public void RediscoveryServices(ServerContent server) { if (server.Type == EndpointType.SECONDARY_SERVER) { DiscoveryServiceSecondary(); } else if (server.Type == EndpointType.CLOUDLET) { DiscoveryCloudletMulticast(); } }
public ServerContent NewInstance() { ServerContent instance = new ServerContent(Type); instance.BandwidthPort = BandwidthPort; instance.DeployAppPort = DeployAppPort; instance.Ip = Ip; instance.JitterRetrieveResultPort = JitterRetrieveResultPort; instance.JitterTestPort = JitterTestPort; instance.PingTcpPort = PingTcpPort; instance.PingUdpPort = PingUdpPort; instance.RpcServicePort = RpcServicePort; instance.SaveProfilePort = SaveProfilePort; return(instance); }
public EndpointController(string secondaryEndpoint, bool decisionMakerActive, bool discoveryCloudlet) { this.decisionMakerActive = decisionMakerActive; SecondaryServer = new ServerContent(EndpointType.SECONDARY_SERVER); CloudletServer = new ServerContent(EndpointType.CLOUDLET); remoteAdvantage = false; if (secondaryEndpoint != null) { SecondaryServerIp(secondaryEndpoint); DiscoveryServiceSecondary(); } if (discoveryCloudlet) { DiscoveryCloudletMulticast(); } }
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(); }
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 DynamicDecisionSystem(ServerContent server) { Server = server; profileDao = new ProfileNetworkDao(); }
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"); } }
public void NetworkAnalysis(ServerContent server) { NetworkAnalysis(server, profileNetwork); }
//on UML = updateDdsEndpoint public void UpdateDynamicDecisionSystemEndpoint(ServerContent server) { dynamicDecisionSystem.Server = server; }
public void StartDecisionMaker(ServerContent server){ lock (mutex) { if (dynamicDecisionSystem == null && decisionMakerActive) { dynamicDecisionSystem = new DynamicDecisionSystem(server); dynamicDecisionSystem.Start(); } } }
public void DeployService(ServerContent server) { new DeployService(server).Start(); }
public ProfileNetworkDefault(ServerContent server) : base(server, "ProfileDefault Started on endpoint: " + server.Ip) { }
public RpcClient() { profile = new RpcProfile(); this.server = null; }
public ServerContent NewInstance() { ServerContent instance = new ServerContent(Type); instance.BandwidthPort = BandwidthPort; instance.DeployAppPort = DeployAppPort; instance.Ip = Ip; instance.JitterRetrieveResultPort = JitterRetrieveResultPort; instance.JitterTestPort = JitterTestPort; instance.PingTcpPort = PingTcpPort; instance.PingUdpPort = PingUdpPort; instance.RpcServicePort = RpcServicePort; instance.SaveProfilePort = SaveProfilePort; return instance; }
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 void SetupServer(ServerContent server) { this.server = server; }
public ProfileNetworkLight(ServerContent server) : base(server, "ProfileLight Started on endpoint: " + server.Ip) { }