private void LoadConfig() { ConfigHander.configuration.Reload(); this.Ip = ConfigHander.GetString("master:ip"); this.Port = ConfigHander.GetInt("master:port"); this.ReconnectionCount = ConfigHander.GetInt("worker:reconnection"); this.TimeOut = ConfigHander.GetInt("worker:timeout"); this.Polling = ConfigHander.GetInt("worker:polling"); }
public void Start() { if (ConfigHander.GetString("type") == "master") { InitMaster(); } else if (ConfigHander.GetString("type") == "worker") { InitClient(); } }
public bool Dispose() { if (ConfigHander.GetString("type") == "master") { Master.Dispose(); } else if (ConfigHander.GetString("type") == "worker") { Client.Dispose(); } return(true); }
public MasterHandler() { this.Ip = ConfigHander.GetString("master:ip"); this.Port = ConfigHander.GetInt("master:port"); Sessions = new ConcurrentDictionary <string, TcpSocketSession>(); }