Add FTP protocol debugging facilities.
[dftpd.git] / Main.cpp
blobd53edc8eddd67a17394ff6ad0dda846df67b2154
1 #include <iostream>
2 #include <unistd.h>
3 #include <signal.h>
4 #include "Server.hpp"
5 #include "LogSTDOUT.hpp"
6 #include "AuthNone.hpp"
7 #include "Exceptions.hpp"
9 bool g_exitRequested = false;
10 Log* g_log = new LogSTDOUT;
12 void RequestExit( int signum )
14 g_exitRequested = true;
17 void Run()
19 ServerPtr server( Server::Create( AuthPtr( new AuthNone ) ) );
21 while( !g_exitRequested )
23 server->Tick();
27 int main()
29 signal( SIGINT, RequestExit );
31 try
33 Run();
35 catch( ServerCrash& e )
37 g_log->Print( "Server crashed" );
38 delete g_log;
39 return 1;
42 delete g_log;
43 return 0;