コード例 #1
0
 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);
 }
コード例 #2
0
ファイル: DeployService.cs プロジェクト: sergiosilvajr/mpos
		public DeployService(ServerContent server)
		{
			this.server = server;

			appName = MposFramework.Instance.DeviceController.AppName;
			appVersion = MposFramework.Instance.DeviceController.Version;
		}
コード例 #3
0
 public void StartDecisionMaker(ServerContent server)
 {
     lock (mutex)
     {
         if (dynamicDecisionSystem == null && decisionMakerActive)
         {
             dynamicDecisionSystem = new DynamicDecisionSystem(server);
             dynamicDecisionSystem.Start();
         }
     }
 }
コード例 #4
0
 public void RediscoveryServices(ServerContent server)
 {
     if (server.Type == EndpointType.SECONDARY_SERVER)
     {
         DiscoveryServiceSecondary();
     }
     else if (server.Type == EndpointType.CLOUDLET)
     {
         DiscoveryCloudletMulticast();
     }
 }
コード例 #5
0
ファイル: ServerContent.cs プロジェクト: georgSquared/mpos
        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);
        }
コード例 #6
0
        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();
            }
        }
コード例 #7
0
		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();
			}
		}
コード例 #8
0
		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();
		}
コード例 #9
0
		public void RediscoveryServices(ServerContent server)
		{
			if (server.Type == EndpointType.SECONDARY_SERVER)
			{
				DiscoveryServiceSecondary();
			}
			else if (server.Type == EndpointType.CLOUDLET)
			{
				DiscoveryCloudletMulticast();
			}
		}
コード例 #10
0
ファイル: DecisionMaker.cs プロジェクト: sergiosilvajr/mpos
		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!");
			}
		}
コード例 #11
0
ファイル: DecisionMaker.cs プロジェクト: sergiosilvajr/mpos
		public DynamicDecisionSystem(ServerContent server)
		{
			Server = server;
			profileDao = new ProfileNetworkDao();
		}
コード例 #12
0
ファイル: ProxyHandler.cs プロジェクト: sergiosilvajr/mpos
		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");
			}
		}
コード例 #13
0
		public void NetworkAnalysis(ServerContent server)
		{
			NetworkAnalysis(server, profileNetwork);
		}
コード例 #14
0
		//on UML = updateDdsEndpoint 
		public void UpdateDynamicDecisionSystemEndpoint(ServerContent server)
		{
			dynamicDecisionSystem.Server = server;
		}
コード例 #15
0
		public void StartDecisionMaker(ServerContent server){
			lock (mutex)
			{
				if (dynamicDecisionSystem == null && decisionMakerActive)
				{
					dynamicDecisionSystem = new DynamicDecisionSystem(server);
					dynamicDecisionSystem.Start();
				}
			}
		}
コード例 #16
0
		public void DeployService(ServerContent server)
		{
			new DeployService(server).Start();
		}
コード例 #17
0
		public ProfileNetworkDefault(ServerContent server) : base(server, "ProfileDefault Started on endpoint: " + server.Ip) { }
コード例 #18
0
ファイル: RpcClient.cs プロジェクト: sergiosilvajr/mpos
		public RpcClient()
		{
			profile = new RpcProfile();
			this.server = null;
		}
コード例 #19
0
 //on UML = updateDdsEndpoint
 public void UpdateDynamicDecisionSystemEndpoint(ServerContent server)
 {
     dynamicDecisionSystem.Server = server;
 }
コード例 #20
0
 public void DeployService(ServerContent server)
 {
     new DeployService(server).Start();
 }
コード例 #21
0
ファイル: ServerContent.cs プロジェクト: sergiosilvajr/mpos
		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;
		}
コード例 #22
0
		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);
		}
コード例 #23
0
ファイル: RpcClient.cs プロジェクト: sergiosilvajr/mpos
		public void SetupServer(ServerContent server)
		{
			this.server = server;
		}
コード例 #24
0
		public ProfileNetworkLight(ServerContent server) : base(server, "ProfileLight Started on endpoint: " + server.Ip) { }