public DataServer(string name, string port) { this.Name = name; this.Port = int.Parse(port); this.state = new NormalState(); this.freeze = new ManualResetEvent(false); this.Files = new List<string>(); this.dataInfo = new DataInfo(); freeze.Set(); this.freezed = false; //create new directory this.currentDir = Environment.CurrentDirectory; string path = currentDir + @"\" + this.Name; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } }
protected void setStateNormal() { this.state = new NormalState(); }
protected void setStateFail() { this.state = new FailedState(); }