예제 #1
0
        public RemoteResult SayIAmHereRemoteResult(ServerId destination)
        {
            if (!_distributorNet.ConnectToDistributor(destination))
            {
                return(new ServerNotAvailable(destination));
            }

            var ret = _distributorNet.SendToDistributor(destination,
                                                        new AddDistributorFromDistributorCommand(new ServerId(_localforproxy)));

            if (!ret.IsError)
            {
                _modelOfAnotherDistributors.AddServer(destination);
                ret = _distributorNet.SendToDistributor(destination, new TakeInfoCommand());

                if (!ret.IsError)
                {
                    var data = ret as SystemInfoResult;
                    AddDistributors(data.DataContainer.AllDistributors);
                }
            }
            return(ret);
        }