Stupid winsock needs special way to close sockets.
[dftpd.git] / Server.hpp
bloba5d9ac304d3cfc385fc9069129347bfc388a92cd
1 #ifndef __DFTPD__SERVER_HPP__
2 #define __DFTPD__SERVER_HPP__
4 #include <list>
5 #include <string>
6 #include "ServerPtr.hpp"
7 #include "Listener.hpp"
8 #include "SessionController.hpp"
9 #include "Auth.hpp"
11 class Server
13 public:
14 static ServerPtr Create( const AuthPtr& auth );
15 static ServerPtr Create( const AuthPtr& auth, const std::string& ip );
16 ~Server();
18 void Tick();
20 void IncomingConnection( int sock );
22 void SetAuth( const AuthPtr& auth ) { m_auth = auth; }
24 const std::list<std::string>& GetWelcomeMessage() const { return m_welcome; }
26 private:
27 Server( const AuthPtr& auth );
28 Server( const AuthPtr& auth, const std::string& ip );
30 void InitListener();
31 void LoadWelcomeMessage();
33 ServerWPtr m_this;
35 ListenerPtr m_listener;
36 SessionControllerPtr m_sessionController;
37 AuthPtr m_auth;
39 std::list<std::string> m_welcome;
42 #endif