private static void SpawnEndpointManager(RemoteConfig config)
        {
            var props = Actor.FromProducer(() => new EndpointManager(config));

            EndpointManagerPid = Actor.Spawn(props);
            EventStream.Instance.Subscribe <EndpointTerminatedEvent>(EndpointManagerPid.Tell);
        }
Exemple #2
0
        public static void Start(string hostname, int port, RemoteConfig config)
        {
            RemoteConfig = config;

            ProcessRegistry.Instance.RegisterHostResolver(pid => new RemoteProcess(pid));

            EndpointManager.Start();
            endpointReader = new EndpointReader();
            server         = new Server
            {
                Services = { Remoting.BindService(endpointReader) },
                Ports    = { new ServerPort(hostname, port, config.ServerCredentials) }
            };
            server.Start();

            var boundPort = server.Ports.Single().BoundPort;
            var boundAddr = $"{hostname}:{boundPort}";
            var addr      = $"{config.AdvertisedHostname??hostname}:{config.AdvertisedPort?? boundPort}";

            ProcessRegistry.Instance.Address = addr;

            SpawnActivator();

            Logger.LogDebug($"Starting Proto.Actor server on {boundAddr} ({addr})");
        }
        public static void Start(string host, int port, RemoteConfig config)
        {
            ProcessRegistry.Instance.RegisterHostResolver(pid => new RemoteProcess(pid));

            _server = new Server
            {
                Services = { Remoting.BindService(new EndpointReader()) },
                Ports    = { new ServerPort(host, port, config.ServerCredentials) },
            };
            _server.Start();

            var boundPort = _server.Ports.Single().BoundPort;
            var addr      = host + ":" + boundPort;

            ProcessRegistry.Instance.Address = addr;

            SpawnEndpointManager(config);
            SpawnActivator();

            _logger.LogDebug($"Starting Proto.Actor server on {addr}");;
        }
        public static void Start(string host, int port, RemoteConfig config)
        {
            ProcessRegistry.Instance.RegisterHostResolver(pid => new RemoteProcess(pid));

            _server = new Server
            {
                Services = { Remoting.BindService(new EndpointReader()) },
                Ports    = { new ServerPort(host, port, config.ServerCredentials) },
            };
            _server.Start();

            var boundPort = _server.Ports.Single().BoundPort;
            var addr      = host + ":" + boundPort;

            ProcessRegistry.Instance.Address = addr;

            var props = Actor.FromProducer(() => new EndpointManager(config));

            EndpointManagerPid = Actor.Spawn(props);

            Console.WriteLine($"[REMOTING] Starting Proto.Actor server on {addr}");
        }
 public EndpointManager(RemoteConfig config)
 {
     _config = config;
 }
 public EndpointManager(RemoteConfig config)
 {
     _config   = config;
     _behavior = new Behavior(ActiveAsync);
 }
        private static void SpawnEndpointManager(RemoteConfig config)
        {
            var props = Actor.FromProducer(() => new EndpointManager(config));

            EndpointManagerPid = Actor.Spawn(props);
        }