Exemplo n.º 1
0
        private IActorChannel BuildActorCenterChannel(ActorIdentity centerActor, ActorIdentity localActor)
        {
            IPAddress actorCenterAddress  = ResolveIPAddress(centerActor.Address);
            int       actorCenterPort     = int.Parse(centerActor.Port);
            var       actorCenterEndPoint = new IPEndPoint(actorCenterAddress, actorCenterPort);

            var centerConnector = new ActorTransportConnector(actorCenterEndPoint);
            var centerChannel   = new ActorConnectorReconnectableChannel(
                localActor, centerConnector, this.ChannelConfiguration);

            return(centerChannel);
        }
Exemplo n.º 2
0
        private IActorChannel BuildCenterActorChannel(ActorIdentity localActor)
        {
            IPAddress centerActorAddress = ResolveIPAddress(this.CenterActor.Address);

            int centerActorPort = -1;

            if (!int.TryParse(this.CenterActor.Port, out centerActorPort) || centerActorPort < 0)
            {
                throw new InvalidOperationException(string.Format(
                                                        "Invalid center actor port, [{0}].", this.CenterActor));
            }

            var centerActorEndPoint = new IPEndPoint(centerActorAddress, centerActorPort);

            var centerConnector = new ActorTransportConnector(centerActorEndPoint, this.ChannelConfiguration.TransportConfiguration);
            var centerChannel   = new ActorConnectorReconnectableChannel(
                localActor, centerConnector, this.ChannelConfiguration);

            return(centerChannel);
        }