Ejemplo n.º 1
0
        public client()
        {
            uuid          = System.Guid.NewGuid().ToString();
            timer         = new service.timerservice();
            modulemanager = new common.modulemanager();

            log.log.logMode = log.log.enLogMode.Release;

            var _process = new juggle.process();

            _gate_call_client = new module.gate_call_client();
            _gate_call_client.onconnect_gate_sucess += on_ack_connect_gate;
            _gate_call_client.onconnect_hub_sucess  += on_ack_connect_hub;
            _gate_call_client.onack_heartbeats      += on_ack_heartbeats;
            _gate_call_client.oncall_client         += on_call_client;
            _process.reg_module(_gate_call_client);
            _conn = new service.connectnetworkservice(_process);
            _conn.onChannelDisconnect += on_disconnect;

            _juggleservice = new service.juggleservice();
            _juggleservice.add_process(_process);

            _heartbeats           = 0;
            _is_enable_heartbeats = false;
            connect_state         = false;
        }
Ejemplo n.º 2
0
        public client()
        {
            uuid          = System.Guid.NewGuid().ToString();
            timer         = new service.timerservice();
            modulemanager = new common.modulemanager();

            var _process = new juggle.process();

            _gate_call_client = new module.gate_call_client();
            _gate_call_client.onconnect_gate_sucess += on_ack_connect_gate;
            _gate_call_client.onconnect_hub_sucess  += on_ack_connect_hub;
            _gate_call_client.onack_heartbeats      += on_ack_heartbeats;
            _gate_call_client.oncall_client         += on_call_client;
            _process.reg_module(_gate_call_client);
            _conn = new service.connectnetworkservice(_process);
            _conn.onChannelDisconnect += on_disconnect;

            var _udp_process = new juggle.process();

            _gate_call_client_fast = new module.gate_call_client_fast();
            _gate_call_client_fast.onconfirm_refresh_udp_end_point += onconfirm_refresh_udp_end_point;
            _gate_call_client_fast.oncall_client += on_call_client;
            _udp_process.reg_module(_gate_call_client_fast);
            _udp_conn = new service.udpconnectnetworkservice(_udp_process);

            _juggleservice = new service.juggleservice();
            _juggleservice.add_process(_process);
            _juggleservice.add_process(_udp_process);

            _heartbeats           = 0;
            _is_enable_heartbeats = false;
        }
Ejemplo n.º 3
0
        public robot(String[] args)
        {
            config.config _config = new config.config(args[0]);
            if (args.Length > 1)
            {
                _config = _config.get_value_dict(args[1]);
            }

            var log_level = _config.get_value_string("log_level");

            if (log_level == "debug")
            {
                log.log.logMode = log.log.enLogMode.Debug;
            }
            else if (log_level == "release")
            {
                log.log.logMode = log.log.enLogMode.Release;
            }
            var log_file = _config.get_value_string("log_file");

            log.log.logFile = log_file;
            var log_dir = _config.get_value_string("log_dir");

            log.log.logPath = log_dir;
            {
                if (!System.IO.Directory.Exists(log_dir))
                {
                    System.IO.Directory.CreateDirectory(log_dir);
                }
            }

            Int64 robot_num = _config.get_value_int("robot_num");

            _ip   = _config.get_value_string("ip");
            _port = (short)_config.get_value_int("port");

            timer         = new service.timerservice();
            modulemanager = new common.modulemanager();

            _process          = new juggle.process();
            _gate_call_client = new module.gate_call_client();
            _gate_call_client.onconnect_gate_sucess  += on_ack_connect_gate;
            _gate_call_client.onack_get_logic        += on_ack_get_logic;
            _gate_call_client.onconnect_logic_sucess += on_ack_connect_logic;
            _gate_call_client.onconnect_hub_sucess   += on_ack_connect_hub;
            _gate_call_client.oncall_client          += on_call_client;
            _process.reg_module(_gate_call_client);

            _conn = new service.connectnetworkservice(_process);

            _juggleservice = new service.juggleservice();
            _juggleservice.add_process(_process);

            proxys = new Dictionary <juggle.Ichannel, client_proxy>();

            _max_robot_num = robot_num;
            _robot_num     = 0;
        }
Ejemplo n.º 4
0
        public client()
        {
            uuid = System.Guid.NewGuid().ToString();
            timer = new service.timerservice();
            modulemanager = new common.modulemanager();

            _process = new juggle.process();
            _gate_call_client = new module.gate_call_client();
            _gate_call_client.onack_connect_server += on_ack_connect_server;
            _gate_call_client.oncall_client += on_call_client;
            _process.reg_module(_gate_call_client);

            _conn = new service.connectnetworkservice(_process);

            _juggleservice = new service.juggleservice();
            _juggleservice.add_process(_process);
        }
Ejemplo n.º 5
0
        public client()
        {
            uuid          = System.Guid.NewGuid().ToString();
            timer         = new service.timerservice();
            modulemanager = new common.modulemanager();

            _process          = new juggle.process();
            _gate_call_client = new module.gate_call_client();
            _gate_call_client.onack_connect_server += on_ack_connect_server;
            _gate_call_client.oncall_client        += on_call_client;
            _process.reg_module(_gate_call_client);

            _conn = new service.connectnetworkservice(_process);

            _juggleservice = new service.juggleservice();
            _juggleservice.add_process(_process);
        }
Ejemplo n.º 6
0
        public robot(Int64 robot_num)
        {
            timer         = new service.timerservice();
            modulemanager = new common.modulemanager();

            _process          = new juggle.process();
            _gate_call_client = new module.gate_call_client();
            _gate_call_client.onconnect_gate_sucess  += on_ack_connect_gate;
            _gate_call_client.onack_get_logic        += on_ack_get_logic;
            _gate_call_client.onconnect_logic_sucess += on_ack_connect_logic;
            _gate_call_client.onconnect_hub_sucess   += on_ack_connect_hub;
            _gate_call_client.oncall_client          += on_call_client;
            _process.reg_module(_gate_call_client);

            _conn = new service.connectnetworkservice(_process);

            _juggleservice = new service.juggleservice();
            _juggleservice.add_process(_process);

            proxys = new Dictionary <juggle.Ichannel, client_proxy>();

            _max_robot_num = robot_num;
            _robot_num     = 0;
        }
Ejemplo n.º 7
0
 public hub_msg_handle(common.modulemanager _modulemanager_, hubmanager _hubmanager_)
 {
     _modulemanager = _modulemanager_;
     _hubmanager    = _hubmanager_;
 }
Ejemplo n.º 8
0
        public logic(String[] args)
        {
            is_busy = false;

            uuid = System.Guid.NewGuid().ToString();

            config.config _config = new config.config(args[0]);
            config.config _center_config = _config.get_value_dict("center");
            if (args.Length > 1)
            {
                _config = _config.get_value_dict(args[1]);
            }

            _closehandle = new closehandle();

            _modulemanager = new common.modulemanager();

            _dbproxy_call_logic = new module.dbproxy_call_logic();
            _dbproxy_process = new juggle.process();
            _dbproxy_process.reg_module(_dbproxy_call_logic);
            _dbproxy_connectnetworkservice = new service.connectnetworkservice(_dbproxy_process);
            dbproxy = new dbproxyproxy(_dbproxy_connectnetworkservice);
            _dbproxy_msg_handle = new dbproxy_msg_handle(dbproxy);
            _dbproxy_call_logic.onreg_logic_sucess += _dbproxy_msg_handle.reg_logic_sucess;
            _dbproxy_call_logic.onack_create_persisted_object += _dbproxy_msg_handle.ack_create_persisted_object;
            _dbproxy_call_logic.onack_updata_persisted_object += _dbproxy_msg_handle.ack_updata_persisted_object;
            _dbproxy_call_logic.onack_get_object_info += _dbproxy_msg_handle.ack_get_object_info;
            _dbproxy_call_logic.onack_get_object_info_end += _dbproxy_msg_handle.ack_get_object_info_end;

            _hub_call_logic = new module.hub_call_logic();
            _hub_process = new juggle.process();
            _hub_process.reg_module(_hub_call_logic);
            _hub_connectnetworkservice = new service.connectnetworkservice(_hub_process);
            hubs = new hubmanager(_hub_connectnetworkservice);
            _hub_msg_handle = new hub_msg_handle(_modulemanager);
            _hub_call_logic.onreg_logic_sucess_and_notify_hub_nominate += _hub_msg_handle.reg_logic_sucess_and_notify_hub_nominate;
            _hub_call_logic.onhub_call_logic_mothed += _hub_msg_handle.hub_call_logic_mothed;

            var ip = _config.get_value_string("ip");
            var port = (short)_config.get_value_int("port");
            _logic_call_logic = new module.logic_call_logic();
            _logic_process = new juggle.process();
            _logic_connectnetworkservice = new service.connectnetworkservice(_logic_process);
            _logic_acceptnetworkservice = new service.acceptnetworkservice(ip, port, _logic_process);
            logics = new logicmanager(_logic_connectnetworkservice);
            _logic_msg_handle = new logic_msg_handle(_modulemanager);
            _logic_call_logic.onreg_logic += _logic_msg_handle.on_reg_logic;
            _logic_call_logic.onack_reg_logic += _logic_msg_handle.on_ack_reg_logic;
            _logic_call_logic.onlogic_call_logic_mothed += _logic_msg_handle.logic_call_logic_mothed;

            _gate_call_logic = new module.gate_call_logic();
            _gate_process = new juggle.process();
            _gate_process.reg_module(_gate_call_logic);
            _gate_connectnetworkservice = new service.connectnetworkservice(_gate_process);
            gates = new gatemanager(_gate_connectnetworkservice);
            _gate_msg_handle = new gate_msg_handle(_modulemanager);
            _gate_call_logic.onreg_logic_sucess += _gate_msg_handle.onreg_logic_sucess;
            _gate_call_logic.onclient_connect += _gate_msg_handle.client_connect;
            _gate_call_logic.onclient_disconnect += _gate_msg_handle.client_disconnect;
            _gate_call_logic.onclient_call_logic += _gate_msg_handle.client_call_logic;

            var center_ip = _center_config.get_value_string("ip");
            var center_port = (short)_center_config.get_value_int("port");
            _center_call_server = new module.center_call_server();
            _center_call_logic = new module.center_call_logic();
            _center_process = new juggle.process();
            _center_process.reg_module(_center_call_server);
            _center_process.reg_module(_center_call_logic);
            _center_connectnetworkservice = new service.connectnetworkservice(_center_process);
            var _center_ch = _center_connectnetworkservice.connect(center_ip, center_port);
            _centerproxy = new centerproxy(_center_ch);
            _center_msg_handle = new center_msg_handle(_closehandle, _centerproxy);
            _center_call_server.onclose_server += _center_msg_handle.close_server;
            _center_call_server.onreg_server_sucess += _center_msg_handle.reg_server_sucess;
            _center_call_logic.ondistribute_server_address += _center_msg_handle.distribute_server_address;
            _center_call_logic.onack_get_server_address += _center_msg_handle.ack_get_server_address;

            _juggle_service = new service.juggleservice();
            _juggle_service.add_process(_dbproxy_process);
            _juggle_service.add_process(_hub_process);
            _juggle_service.add_process(_gate_process);
            _juggle_service.add_process(_logic_process);
            _juggle_service.add_process(_center_process);

            timer = new service.timerservice();

            _centerproxy.reg_logic(ip, port, uuid);
        }
Ejemplo n.º 9
0
        public hub(String[] args)
        {
            uuid = System.Guid.NewGuid().ToString();

            config.config _config        = new config.config(args[0]);
            config.config _center_config = _config.get_value_dict("center");
            if (args.Length > 1)
            {
                _config = _config.get_value_dict(args[1]);
            }

            name = _config.get_value_string("hub_name");

            closeHandle = new closehandle();

            logics  = new logicmanager();
            modules = new common.modulemanager();

            var ip   = _config.get_value_string("ip");
            var port = (short)_config.get_value_int("port");

            _logic_msg_handle = new logic_msg_handle(modules, logics);
            _logic_call_hub   = new module.hub();
            _logic_call_hub.onlogic_call_hub_mothed += _logic_msg_handle.logic_call_hub_mothed;
            _logic_call_hub.onreg_logic             += _logic_msg_handle.reg_logic;
            var _logic_process = new juggle.process();

            _logic_process.reg_module(_logic_call_hub);
            _accept_logic_service = new service.acceptnetworkservice(ip, port, _logic_process);

            var center_ip   = _center_config.get_value_string("ip");
            var center_port = (short)_center_config.get_value_int("port");

            _center_call_hub    = new module.center_call_hub();
            _center_call_server = new module.center_call_server();
            var _center_process = new juggle.process();

            _center_process.reg_module(_center_call_hub);
            _center_process.reg_module(_center_call_server);
            _connect_center_service = new service.connectnetworkservice(_center_process);
            var center_ch = _connect_center_service.connect(center_ip, center_port);

            _centerproxy       = new centerproxy(center_ch);
            _center_msg_handle = new center_msg_handle(this, closeHandle, _centerproxy);
            _center_call_server.onreg_server_sucess       += _center_msg_handle.reg_server_sucess;
            _center_call_server.onclose_server            += _center_msg_handle.close_server;
            _center_call_hub.ondistribute_dbproxy_address += _center_msg_handle.distribute_dbproxy_address;

            var _dbproxy_process = new juggle.process();

            _connect_dbproxy_service            = new service.connectnetworkservice(_dbproxy_process);
            _dbproxy_msg_handle                 = new dbproxy_msg_handle(dbproxy);
            _dbproxy_call_hub                   = new module.dbproxy_call_hub();
            _dbproxy_call_hub.onreg_hub_sucess += _dbproxy_msg_handle.reg_hub_sucess;
            _dbproxy_call_hub.onack_create_persisted_object += _dbproxy_msg_handle.ack_create_persisted_object;
            _dbproxy_call_hub.onack_updata_persisted_object += _dbproxy_msg_handle.ack_updata_persisted_object;
            _dbproxy_call_hub.onack_get_object_info         += _dbproxy_msg_handle.ack_get_object_info;
            _dbproxy_call_hub.onack_get_object_info_end     += _dbproxy_msg_handle.ack_get_object_info_end;
            _dbproxy_process.reg_module(_dbproxy_call_hub);

            _juggle_service = new service.juggleservice();
            _juggle_service.add_process(_logic_process);
            _juggle_service.add_process(_center_process);
            _juggle_service.add_process(_dbproxy_process);

            timer = new service.timerservice();

            _centerproxy.reg_hub(ip, port, uuid);
        }
Ejemplo n.º 10
0
        public logic(String[] args)
        {
            is_busy = false;

            uuid = System.Guid.NewGuid().ToString();

            config.config _config        = new config.config(args[0]);
            config.config _center_config = _config.get_value_dict("center");
            if (args.Length > 1)
            {
                _config = _config.get_value_dict(args[1]);
            }

            var log_level = _config.get_value_string("log_level");

            if (log_level == "debug")
            {
                log.log.logMode = log.log.enLogMode.Debug;
            }
            else if (log_level == "release")
            {
                log.log.logMode = log.log.enLogMode.Release;
            }
            var log_file = _config.get_value_string("log_file");

            log.log.logFile = log_file;
            var log_dir = _config.get_value_string("log_dir");

            log.log.logPath = log_dir;
            {
                if (!System.IO.Directory.Exists(log_dir))
                {
                    System.IO.Directory.CreateDirectory(log_dir);
                }
            }

            closeHandle = new closehandle();

            modules = new common.modulemanager();

            _dbproxy_call_logic = new module.dbproxy_call_logic();
            _dbproxy_process    = new juggle.process();
            _dbproxy_process.reg_module(_dbproxy_call_logic);
            _dbproxy_connectnetworkservice = new service.connectnetworkservice(_dbproxy_process);
            dbproxy             = new dbproxyproxy(_dbproxy_connectnetworkservice);
            _dbproxy_msg_handle = new dbproxy_msg_handle(dbproxy, this);
            _dbproxy_call_logic.onreg_logic_sucess            += _dbproxy_msg_handle.reg_logic_sucess;
            _dbproxy_call_logic.onack_create_persisted_object += _dbproxy_msg_handle.ack_create_persisted_object;
            _dbproxy_call_logic.onack_updata_persisted_object += _dbproxy_msg_handle.ack_updata_persisted_object;
            _dbproxy_call_logic.onack_get_object_info         += _dbproxy_msg_handle.ack_get_object_info;
            _dbproxy_call_logic.onack_get_object_info_end     += _dbproxy_msg_handle.ack_get_object_info_end;

            _hub_call_logic = new module.hub_call_logic();
            _hub_process    = new juggle.process();
            _hub_process.reg_module(_hub_call_logic);
            _hub_connectnetworkservice = new service.connectnetworkservice(_hub_process);
            hubs            = new hubmanager(_hub_connectnetworkservice);
            _hub_msg_handle = new hub_msg_handle(modules);
            _hub_call_logic.onreg_logic_sucess_and_notify_hub_nominate += _hub_msg_handle.reg_logic_sucess_and_notify_hub_nominate;
            _hub_call_logic.onhub_call_logic_mothed += _hub_msg_handle.hub_call_logic_mothed;

            var ip   = _config.get_value_string("ip");
            var port = (short)_config.get_value_int("port");

            _logic_call_logic            = new module.logic_call_logic();
            _logic_process               = new juggle.process();
            _logic_connectnetworkservice = new service.connectnetworkservice(_logic_process);
            _logic_acceptnetworkservice  = new service.acceptnetworkservice(ip, port, _logic_process);
            logics                                       = new logicmanager(_logic_connectnetworkservice);
            _logic_msg_handle                            = new logic_msg_handle(modules);
            _logic_call_logic.onreg_logic               += _logic_msg_handle.on_reg_logic;
            _logic_call_logic.onack_reg_logic           += _logic_msg_handle.on_ack_reg_logic;
            _logic_call_logic.onlogic_call_logic_mothed += _logic_msg_handle.logic_call_logic_mothed;

            _gate_call_logic = new module.gate_call_logic();
            _gate_process    = new juggle.process();
            _gate_process.reg_module(_gate_call_logic);
            _gate_connectnetworkservice = new service.connectnetworkservice(_gate_process);
            gates            = new gatemanager(_gate_connectnetworkservice);
            _gate_msg_handle = new gate_msg_handle(modules);
            _gate_call_logic.onreg_logic_sucess  += _gate_msg_handle.onreg_logic_sucess;
            _gate_call_logic.onclient_get_logic  += _gate_msg_handle.client_get_logic;
            _gate_call_logic.onclient_connect    += _gate_msg_handle.client_connect;
            _gate_call_logic.onclient_disconnect += _gate_msg_handle.client_disconnect;
            _gate_call_logic.onclient_exception  += _gate_msg_handle.client_exception;
            _gate_call_logic.onclient_call_logic += _gate_msg_handle.client_call_logic;

            var center_ip   = _center_config.get_value_string("ip");
            var center_port = (short)_center_config.get_value_int("port");

            _center_call_server = new module.center_call_server();
            _center_call_logic  = new module.center_call_logic();
            _center_process     = new juggle.process();
            _center_process.reg_module(_center_call_server);
            _center_process.reg_module(_center_call_logic);
            _center_connectnetworkservice = new service.connectnetworkservice(_center_process);
            var _center_ch = _center_connectnetworkservice.connect(center_ip, center_port);

            _centerproxy       = new centerproxy(_center_ch);
            _center_msg_handle = new center_msg_handle(closeHandle, _centerproxy);
            _center_call_server.onclose_server             += _center_msg_handle.close_server;
            _center_call_server.onreg_server_sucess        += _center_msg_handle.reg_server_sucess;
            _center_call_logic.ondistribute_server_address += _center_msg_handle.distribute_server_address;
            _center_call_logic.onack_get_server_address    += _center_msg_handle.ack_get_server_address;

            _juggle_service = new service.juggleservice();
            _juggle_service.add_process(_dbproxy_process);
            _juggle_service.add_process(_hub_process);
            _juggle_service.add_process(_gate_process);
            _juggle_service.add_process(_logic_process);
            _juggle_service.add_process(_center_process);

            timer = new service.timerservice();

            _centerproxy.reg_logic(ip, port, uuid);
        }
Ejemplo n.º 11
0
        public hub(String[] args)
        {
            uuid = System.Guid.NewGuid().ToString();

            config = new config.config(args[0]);
            config.config _center_config = config.get_value_dict("center");
            if (args.Length > 1)
            {
                config = config.get_value_dict(args[1]);
            }

            var log_level = config.get_value_string("log_level");

            if (log_level == "debug")
            {
                log.log.logMode = log.log.enLogMode.Debug;
            }
            else if (log_level == "release")
            {
                log.log.logMode = log.log.enLogMode.Release;
            }
            var log_file = config.get_value_string("log_file");

            log.log.logFile = log_file;
            var log_dir = config.get_value_string("log_dir");

            log.log.logPath = log_dir;
            {
                if (!System.IO.Directory.Exists(log_dir))
                {
                    System.IO.Directory.CreateDirectory(log_dir);
                }
            }

            name = config.get_value_string("hub_name");

            closeHandle = new closehandle();
            modules     = new common.modulemanager();

            var _hub_logic_process = new juggle.process();

            _connect_hub_service = new service.connectnetworkservice(_hub_logic_process);

            hubs = new hubmanager();

            _hub_msg_handle                      = new hub_msg_handle(modules, hubs);
            _hub_call_hub                        = new module.hub_call_hub();
            _hub_call_hub.onreg_hub             += _hub_msg_handle.reg_hub;
            _hub_call_hub.onreg_hub_sucess      += _hub_msg_handle.reg_hub_sucess;
            _hub_call_hub.onhub_call_hub_mothed += _hub_msg_handle.hub_call_hub_mothed;
            _hub_logic_process.reg_module(_hub_call_hub);

            var ip   = config.get_value_string("ip");
            var port = (short)config.get_value_int("port");

            _accept_logic_service = new service.acceptnetworkservice(ip, port, _hub_logic_process);

            var center_ip   = _center_config.get_value_string("ip");
            var center_port = (short)_center_config.get_value_int("port");

            _center_call_hub    = new module.center_call_hub();
            _center_call_server = new module.center_call_server();
            var _center_process = new juggle.process();

            _center_process.reg_module(_center_call_hub);
            _center_process.reg_module(_center_call_server);
            _connect_center_service = new service.connectnetworkservice(_center_process);
            var center_ch = _connect_center_service.connect(center_ip, center_port);

            _centerproxy       = new centerproxy(center_ch);
            _center_msg_handle = new center_msg_handle(this, closeHandle, _centerproxy);
            _center_call_server.onreg_server_sucess      += _center_msg_handle.reg_server_sucess;
            _center_call_server.onclose_server           += _center_msg_handle.close_server;
            _center_call_hub.ondistribute_server_address += _center_msg_handle.distribute_server_address;
            _center_call_hub.onreload += onReload_event;

            var _dbproxy_process = new juggle.process();

            _connect_dbproxy_service            = new service.connectnetworkservice(_dbproxy_process);
            _dbproxy_msg_handle                 = new dbproxy_msg_handle(this);
            _dbproxy_call_hub                   = new module.dbproxy_call_hub();
            _dbproxy_call_hub.onreg_hub_sucess += _dbproxy_msg_handle.reg_hub_sucess;
            _dbproxy_call_hub.onack_create_persisted_object += _dbproxy_msg_handle.ack_create_persisted_object;
            _dbproxy_call_hub.onack_updata_persisted_object += _dbproxy_msg_handle.ack_updata_persisted_object;
            _dbproxy_call_hub.onack_get_object_count        += _dbproxy_msg_handle.ack_get_object_count;
            _dbproxy_call_hub.onack_get_object_info         += _dbproxy_msg_handle.ack_get_object_info;
            _dbproxy_call_hub.onack_get_object_info_end     += _dbproxy_msg_handle.ack_get_object_info_end;
            _dbproxy_call_hub.onack_remove_object           += _dbproxy_msg_handle.ack_remove_object;

            _dbproxy_process.reg_module(_dbproxy_call_hub);

            juggle.process _gate_process = new juggle.process();
            _gate_msg_handle = new gate_msg_handle(modules);
            _gate_call_hub   = new module.gate_call_hub();
            _gate_call_hub.onreg_hub_sucess    += _gate_msg_handle.reg_hub_sucess;
            _gate_call_hub.onclient_connect    += _gate_msg_handle.client_connect;
            _gate_call_hub.onclient_disconnect += _gate_msg_handle.client_disconnect;
            _gate_call_hub.onclient_exception  += _gate_msg_handle.client_exception;
            _gate_call_hub.onclient_call_hub   += _gate_msg_handle.client_call_hub;
            _gate_process.reg_module(_gate_call_hub);
            _connect_gate_servcie = new service.connectnetworkservice(_gate_process);
            gates = new gatemanager(_connect_gate_servcie);

            _juggle_service = new service.juggleservice();
            _juggle_service.add_process(_hub_logic_process);
            _juggle_service.add_process(_center_process);
            _juggle_service.add_process(_dbproxy_process);
            _juggle_service.add_process(_gate_process);

            timer = new service.timerservice();

            _centerproxy.reg_hub(ip, port, uuid);
        }
Ejemplo n.º 12
0
        public hub(String[] args)
        {
            uuid = System.Guid.NewGuid().ToString();

            config.config _config = new config.config(args[0]);
            config.config _center_config = _config.get_value_dict("center");
            if (args.Length > 1)
            {
                _config = _config.get_value_dict(args[1]);
            }

            name = _config.get_value_string("hub_name");

            _closehandle = new closehandle();

            logics = new logicmanager();
            _modulemanager = new common.modulemanager();

            var ip = _config.get_value_string("ip");
            var port = (short)_config.get_value_int("port");
            _logic_msg_handle = new logic_msg_handle(_modulemanager, logics);
            _logic_call_hub = new module.hub();
            _logic_call_hub.onlogic_call_hub_mothed += _logic_msg_handle.logic_call_hub_mothed;
            _logic_call_hub.onreg_logic += _logic_msg_handle.reg_logic;
            var _logic_process = new juggle.process();
            _logic_process.reg_module(_logic_call_hub);
            _accept_logic_service = new service.acceptnetworkservice(ip, port, _logic_process);

            var center_ip = _center_config.get_value_string("ip");
            var center_port = (short)_center_config.get_value_int("port");
            _center_call_hub = new module.center_call_hub();
            _center_call_server = new module.center_call_server();
            var _center_process = new juggle.process();
            _center_process.reg_module(_center_call_hub);
            _center_process.reg_module(_center_call_server);
            _connect_center_service = new service.connectnetworkservice(_center_process);
            var center_ch = _connect_center_service.connect(center_ip, center_port);
            _centerproxy = new centerproxy(center_ch);
            _center_msg_handle = new center_msg_handle(this, _closehandle, _centerproxy);
            _center_call_server.onreg_server_sucess += _center_msg_handle.reg_server_sucess;
            _center_call_server.onclose_server += _center_msg_handle.close_server;
            _center_call_hub.ondistribute_dbproxy_address += _center_msg_handle.distribute_dbproxy_address;

            var _dbproxy_process = new juggle.process();
            _connect_dbproxy_service = new service.connectnetworkservice(_dbproxy_process);
            _dbproxy_msg_handle = new dbproxy_msg_handle(dbproxy);
            _dbproxy_call_hub = new module.dbproxy_call_hub();
            _dbproxy_call_hub.onreg_hub_sucess += _dbproxy_msg_handle.reg_hub_sucess;
            _dbproxy_call_hub.onack_create_persisted_object += _dbproxy_msg_handle.ack_create_persisted_object;
            _dbproxy_call_hub.onack_updata_persisted_object += _dbproxy_msg_handle.ack_updata_persisted_object;
            _dbproxy_call_hub.onack_get_object_info += _dbproxy_msg_handle.ack_get_object_info;
            _dbproxy_call_hub.onack_get_object_info_end += _dbproxy_msg_handle.ack_get_object_info_end;
            _dbproxy_process.reg_module(_dbproxy_call_hub);

            _juggle_service = new service.juggleservice();
            _juggle_service.add_process(_logic_process);
            _juggle_service.add_process(_center_process);
            _juggle_service.add_process(_dbproxy_process);

            timer = new service.timerservice();

            _centerproxy.reg_hub(ip, port, uuid);
        }
Ejemplo n.º 13
0
 public gate_msg_handle(common.modulemanager _modulemanager_)
 {
     _modulemanager = _modulemanager_;
 }
Ejemplo n.º 14
0
 public logic_msg_handle(common.modulemanager _modulemanager_, logicmanager _logicmanager_)
 {
     _modulemanager = _modulemanager_;
     _logicmanager = _logicmanager_;
 }
Ejemplo n.º 15
0
 public logic_msg_handle(common.modulemanager _modulemanager_, logicmanager _logicmanager_)
 {
     _modulemanager = _modulemanager_;
     _logicmanager  = _logicmanager_;
 }
Ejemplo n.º 16
0
 public gate_msg_handle(common.modulemanager _modulemanager_)
 {
     _modulemanager = _modulemanager_;
 }