Esempio n. 1
0
 public GroupCallManager(ushort groupId, RopuProtocol ropuProtocol, ServingNodes servingNodes, KeysClient keysClient)
 {
     _groupId      = groupId;
     _ropuProtocol = ropuProtocol;
     _servingNodes = servingNodes;
     _keysClient   = keysClient;
 }
Esempio n. 2
0
 public CallControl(
     LoadBalancerProtocol loadBalancerProtocol,
     ServiceDiscovery serviceDiscovery,
     RopuProtocol ropuProtocol,
     ServingNodes servingNodes,
     ServicesClient servicesClient,
     KeysClient keysClient)
 {
     _loadBalancerProtocol = loadBalancerProtocol;
     _loadBalancerProtocol.SetClientMessageHandler(this);
     _serviceDiscovery = serviceDiscovery;
     _ropuProtocol     = ropuProtocol;
     _ropuProtocol.SetMessageHandler(this);
     _servingNodes   = servingNodes;
     _servicesClient = servicesClient;
     _keysClient     = keysClient;
 }
Esempio n. 3
0
        static async Task Main(string[] args)
        {
            Console.WriteLine("Starting Ropu Call Controller");
            Console.WriteLine("Copyright (c) Daniel Hughes 2018");
            Console.WriteLine();

            var settingsReader = new CommandLineSettingsReader();
            var settings       = settingsReader.ParseArgs(args);

            if (settings == null)
            {
                return;
            }

            var credentialsProvider = new CredentialsProvider()
            {
                Email    = settings.Email,
                Password = settings.Password
            };
            var webClient = new RopuWebClient("https://192.168.1.9:5001", credentialsProvider);

            var portFinder           = new PortFinder();
            var keysClient           = new KeysClient(webClient, true, encryptionKey => new CachedEncryptionKey(encryptionKey, key => new AesGcmWrapper(key)));
            var packetEncryption     = new PacketEncryption(keysClient);
            var ropuProtocol         = new RopuProtocol(portFinder, 9000, packetEncryption);
            var loadBalancerProtocol = new LoadBalancerProtocol(portFinder, StartingControlPort, packetEncryption, keysClient);
            var serviceDiscovery     = new ServiceDiscovery();
            var servingNodes         = new ServingNodes(100);


            var servicesClient = new ServicesClient(webClient, ServiceType.CallController);

            var callControl = new CallControl(
                loadBalancerProtocol,
                serviceDiscovery,
                ropuProtocol,
                servingNodes,
                servicesClient,
                keysClient);

            await callControl.Run();
        }