DAAP.Server.Commit C# (CSharp) Method

Commit() public method

public Commit ( ) : void
return void
        public void Commit()
        {
            List<Database> clones = new List<Database> ();
            foreach (Database db in databases) {
                clones.Add ((Database) db.Clone ());
            }

            lock (revmgr) {
                revmgr.AddRevision (clones);
                Monitor.PulseAll (revmgr);
            }
        }

Usage Example

コード例 #1
0
ファイル: Daemon.cs プロジェクト: snorp/tangerine
        public static void Run()
        {
            InitializeLogging ();

            if (!File.Exists (ConfigPath)) {
                log.WarnFormat ("Config file '{0}' was not found, using defaults", ConfigPath);
            }

            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            #if LINUX || MACOSX
            UnixSignal.RegisterHandler (Signum.SIGTERM, OnSignal);
            UnixSignal.RegisterHandler (Signum.SIGINT, OnSignal);
            UnixSignal.Start ();
            #else
            Application.EnableVisualStyles ();
            Application.SetCompatibleTextRenderingDefault (false);
            #endif

            server = new Server (Name);
            server.UserLogin += OnUserLogin;
            server.UserLogout += OnUserLogout;
            server.Port = Port;
            server.IsPublished = IsPublished;
            server.Collision += OnCollision;
            db = new Database (Name);
            server.AddDatabase (db);
            server.MaxUsers = MaxUsers;

            server.TrackRequested += OnTrackRequested;

            log.Info ("Server name: " + Name);

            PluginManager.LoadPlugins (PluginNames);

            #if LINUX
            if (Inotify.Enabled) {
                Inotify.Start ();
            }
            #endif

            AddUsers ();

            try {
                lock (server) {
                    server.Commit ();
                    server.Start ();
                }
            } catch (Exception e) {
                LogError ("Failed to start server", e);
                Shutdown ();
            }

            RunLoop ();
            Shutdown ();
        }
All Usage Examples Of DAAP.Server::Commit