Beispiel #1
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)
        {
            var addr = host + ":" + port;

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

            _server = new Server
            {
                Services = { Remoting.BindService(new EndpointReader()) },
                Ports    = { new ServerPort(host, port, ServerCredentials.Insecure) }
            };
            _server.Start();
            var emProps =
                Actor.FromProducer(() => new EndpointManager());

            EndpointManagerPid = Actor.Spawn(emProps);

            Console.WriteLine($"[REMOTING] Starting Proto.Actor server on {addr}");
        }
Beispiel #3
0
        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}");
        }