Пример #1
0
        public MainServer()
        {
            Server.cn.StateChange += new StateChangeEventHandler(cn_StateChange);
            this.status            = ServerStatus.STATUS_UNDEFINED;

            this.activeCalls   = new Hashtable();
            this.ctiserver     = new CTIServer();
            sock               = new SocketManager(Server.cfg.MANAGER_HOST, Server.cfg.MANAGER_PORT);
            sock.Connected    += new SocketManager.OnConnected(sock_Connected);
            sock.DataArrival  += new SocketManager.OnDataArrival(sock_DataArrival);
            sock.Disconnected += new SocketManager.OnDisconnected(sock_Disconnected);
            sock.SocketError  += new SocketManager.OnSocketError(sock_SocketError);
            t = new Thread(new ThreadStart(this.StartServer));
            t.Start();
            t1 = new Thread(new ThreadStart(this.MySQLKeepAlive));
            t1.Start();
            sock.Connect();
        }
Пример #2
0
        public MainServer()
        {
            Server.cn.StateChange += new StateChangeEventHandler(cn_StateChange);
            this.status = ServerStatus.STATUS_UNDEFINED;

            this.activeCalls = new Hashtable();
            this.ctiserver = new CTIServer();
            sock = new SocketManager(Server.cfg.MANAGER_HOST, Server.cfg.MANAGER_PORT);
            sock.Connected += new SocketManager.OnConnected(sock_Connected);
            sock.DataArrival += new SocketManager.OnDataArrival(sock_DataArrival);
            sock.Disconnected += new SocketManager.OnDisconnected(sock_Disconnected);
            sock.SocketError += new SocketManager.OnSocketError(sock_SocketError);
            t = new Thread(new ThreadStart(this.StartServer));
            t.Start();
            t1 = new Thread(new ThreadStart(this.MySQLKeepAlive));
            t1.Start();
            sock.Connect();
        }