Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
 protected void setStateNormal()
 {
     this.state = new NormalState();
 }
Beispiel #3
0
 protected void setStateFail()
 {
     this.state = new FailedState();
 }