Example #1
0
 public void StartService(ConnectionVO connVO)
 {
     if (!this.ServerReady)
     {
         throw new Exception("서버가 준비되지 않았습니다");
     }
     if (ServerConsole.ActiveServiceDic[connVO.ServiceURL])
     {
         throw new Exception("이미 활성화된 서비스 입니다");
     }
     ServerConsole.AddService(connVO);
 }
Example #2
0
        public void AddService(IList <ConnectionVO> connVOList)
        {
            if (!this.ServerReady)
            {
                throw new Exception("서버가 준비되지 않았습니다");
            }
            //중복된 URL골라내기
            IList <ConnectionVO> _connVOList = new List <ConnectionVO>();

            if (WebServiceServer.ServerMain.getInstance().ActiveServiceDic != null && WebServiceServer.ServerMain.getInstance().ActiveServiceDic.Count > 0)
            {
                //이미 활성화된 서비스가 있는경우 URL등 중복방지
                foreach (ConnectionVO connVO in connVOList)
                {
                    bool isDuplicate = false;
                    foreach (string url in WebServiceServer.ServerMain.getInstance().ActiveServiceDic.Keys)
                    {
                        if (connVO.ServiceURL == url)
                        {
                            isDuplicate = true;
                            break;
                        }
                    }
                    if (!isDuplicate)
                    {
                        _connVOList.Add(connVO);
                    }
                }
            }
            else
            {
                //이미 활성화된 서비스가 하나도 없을때
                foreach (ConnectionVO connVO in connVOList)
                {
                    _connVOList.Add(connVO);
                }
            }
            ServerConsole.AddService(_connVOList);
        }
Example #3
0
        public void AddService(ConnectionVO connVO)
        {
            if (!this.ServerReady)
            {
                throw new Exception("서버가 준비되지 않았습니다");
            }
            //중복된 URL골라내기
            bool isDuplicate = false;
            IDictionary <string, bool> serviceDic = WebServiceServer.ServerMain.getInstance().ActiveServiceDic;
            ICollection <string>       urlList    = serviceDic.Keys;

            foreach (string url in urlList)
            {
                if (connVO.ServiceURL == url)
                {
                    isDuplicate = true;
                    break;
                }
            }
            if (!isDuplicate)
            {
                ServerConsole.AddService(connVO);
            }
        }