1 /***************************************************************************
3 * Copyright (C) 2006 David Brodsky *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License as *
7 * published by the Free Software Foundation and appearing *
8 * in the file LICENSE.GPL included in the packaging of this file. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13 * General Public License for more details. *
15 ***************************************************************************/
20 #include <tairon/core/config.h>
21 #include <tairon/core/modulemanager.h>
22 #include <tairon/core/threadmanager.h>
23 #include <tairon/net/limitmanager.h>
24 #include <tairon/util/objectmanager.h>
26 #include "netthread.h"
28 int main(int argc
, char **argv
)
30 // don't crash on broken pipe signal
31 signal(SIGPIPE
, SIG_IGN
);
33 Tairon::Core::ThreadManager
*threadmanager
= 0;
34 Tairon::Util::ObjectManager
*objectmanager
= 0;
35 Tairon::Core::ModuleManager
*modulemanager
= 0;
37 Tairent::Core::NetThread
*netthread
= 0;
40 Tairon::Core::Config
config("tairent.xml");
41 threadmanager
= new Tairon::Core::ThreadManager();
42 objectmanager
= new Tairon::Util::ObjectManager();
43 modulemanager
= new Tairon::Core::ModuleManager();
45 netthread
= new Tairent::Core::NetThread();
48 modulemanager
->initialize();
49 } catch (const Tairon::Core::Exception
&e
) {
50 std::cerr
<< "Caught exception in main: " << (Tairon::Core::String
) e
<< std::endl
;
59 modulemanager
->unloadModules();
64 // this is perfectly valid, even if an exception has been thrown - deleting
65 // null pointer is correct
71 // vim: ai sw=4 ts=4 noet fdm=marker