00001 00009 #ifndef SERVER_H 00010 #define SERVER_H 00011 00012 #include "connection.h" 00013 #include "log.h" 00014 #include "eventqueue.h" 00015 00017 typedef list<Connection*> ConnList; 00018 00032 class Server { 00033 public: 00034 Server(EventQueue& r_inque, EventQueue& r_outque, Log& r_lgfile); 00035 virtual ~Server(); 00036 00037 virtual bool Boot(unsigned short port); 00038 virtual void Run(void * parms); 00039 Log& ServerLog(); 00040 private: 00041 Server(const Server&); 00042 Server& operator=(const Server&); 00043 00044 bool mShutdown; 00045 fd_set mInputFDs; 00046 fd_set mOutputFDs; 00047 SOCKET mAcceptor; 00048 struct sockaddr_in mTo; 00049 ConnList mConns; 00050 int mNumFds; 00051 00052 Log& mrLog; 00053 EventQueue& mrInQueue; 00054 EventQueue& mrOutQueue; 00055 00056 void AcceptConnection(); 00057 void InitFDs (); 00058 void ProcessQueue(); 00059 void ShutdownServer(); 00060 bool SetNonBlocking(SOCKET s); 00061 }; 00062 00063 #endif // SERVER_H 00064
1.2.17