Esempio n. 1
0
        public bool Init(ConoDBConfig config)
        {
            try
            {
                dbJobQueue = new ConoDBJobQueue();

                if (dbJobQueue.Init() == false)
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }
            dbConnection = new ConoDBConnection();

            if (dbConnection.Init(config.ip, config.port, config.dbName, config.uid, config.pwd) == false)
            {
                return(false);
            }

            this.handler = config.handler;

            return(true);
        }
Esempio n. 2
0
        public bool Init(int threadCount, ConoDBConfig config)
        {
            try
            {
                processores = new ConoDBProcessor[threadCount];

                for (int i = 0; i < threadCount; i++)
                {
                    processores[i] = new ConoDBProcessor();
                    if (processores[i].Init(config) == false)
                    {
                        //error
                        Console.WriteLine("db init error");
                        return(false);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
            return(true);
        }