Ejemplo n.º 1
0
        public virtual async Task <RegistAreaResponse> AreaRegist(RegistAreaRequest reg)
        {
            IRemoteService svc;

            try
            {
                svc = await base.Provider.GetAsync(new RemoteAddress(reg.areaName, reg.areaNode));

                if (svc != null)
                {
                    var node = areas.GetOrAdd(svc.Address.ServiceNode, (n) => new ValueSortedMap <string, AreaInfo>(AreaComparison));
                    node.Add(svc.Address.ServiceName, new AreaInfo(svc));
                    return(new RegistAreaResponse());
                }
                else
                {
                    return(new RegistAreaResponse()
                    {
                        s2c_code = RegistAreaResponse.CODE_ERROR
                    });
                }
            }
            catch (Exception err)
            {
                log.Error(err.Message, err);
                throw;
            }
        }
Ejemplo n.º 2
0
 public virtual Task <RegistAreaResponse> area_rpc_RegistAreaAsync(RegistAreaRequest reg)
 {
     return(AreaRegist(reg));
 }