Example #1
0
        public void WriteSesionInfo(SessionInfo session)
        {
            try
            {
                string dir = Path.Combine(CachePath, session.SessionId);
                string rds = Path.Combine(dir, "0.rds");
                Debug.Assert(!Directory.Exists(dir));
                Debug.Assert(!File.Exists(rds));

                Directory.CreateDirectory(dir);
                SerializeEngine.Serialize(session, rds);
            }
            catch (Exception ex) { TraceLog.WriteException(ex); throw; }
        }
Example #2
0
        public void WriteSnapshot(SessionInfo session, Snapshot sshot)
        {
            try
            {
                string dir = Path.Combine(CachePath, session.SessionId);
                string rds = Path.Combine(dir, "0.rds");
                string rdi = Path.Combine(dir, sshot.SnapshotId + ".rdi");
                Debug.Assert(Directory.Exists(dir));
                Debug.Assert(File.Exists(rds));
                Debug.Assert(!File.Exists(rdi));

                if (!Directory.Exists(dir) || !File.Exists(rds))
                {
                    Directory.CreateDirectory(dir);
                    SerializeEngine.Serialize(session, rds);
                }
                SerializeEngine.Serialize(sshot, rdi);
            }
            catch (Exception ex) { TraceLog.WriteException(ex); throw; }
        }