Exemplo n.º 1
0
        public void StartConnectServerTest()
        {
            Connecter target          = new Connecter(); // TODO: 初始化为适当的值
            string    strHostNamePort = string.Empty;    // TODO: 初始化为适当的值
            bool      expected        = false;           // TODO: 初始化为适当的值
            bool      actual;

            actual = target.StartConnectServer(strHostNamePort);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        private bool ConnectToDomainServer()
        {
            if (m_ConfigZoneCluster == null)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, LanguageString.SingletonInstance.ZoneClusterString001);

                return(false);
            }

            //////////////////////////////////////////////////////////////////////////
            // 开始监听端口

            if (m_ConfigZoneCluster.ZoneClusterHost == string.Empty)
            {
                if (m_Listener.StartServer(m_ConfigZoneCluster.ZoneClusterPort) == false)
                {
                    LOGs.WriteLine(LogMessageType.MSG_ERROR, LanguageString.SingletonInstance.ZoneClusterString002, m_ConfigZoneCluster.ZoneClusterPort);

                    return(false);
                }
            }
            else
            {
                string strHostNamePort = m_ConfigZoneCluster.ZoneClusterHost + ":" + m_ConfigZoneCluster.ZoneClusterPort;

                if (m_Listener.StartServer(strHostNamePort) == false)
                {
                    LOGs.WriteLine(LogMessageType.MSG_ERROR, LanguageString.SingletonInstance.ZoneClusterString003, strHostNamePort);

                    return(false);
                }
            }


            //////////////////////////////////////////////////////////////////////////
            // 连接Domain服务端

            string strHostNamePort2 = m_ConfigZoneCluster.DomainHost + ":" + m_ConfigZoneCluster.DomainPort;

            if (m_Connecter.StartConnectServer(strHostNamePort2) == false)
            {
                LOGs.WriteLine(LogMessageType.MSG_ERROR, LanguageString.SingletonInstance.ZoneClusterString004, strHostNamePort2);

                m_Listener.Dispose();
                return(false);
            }

            return(true);
        }