#ifndef _YPROXY_YPROXYTHREAD_HPP_ #define _YPROXY_YPROXYTHREAD_HPP_ #ifndef _SOCKET_SOCKET_HPP_ #include #endif #ifndef _THREAD_MESSAGETHREAD_HPP_ #include #endif #ifndef _THREAD_EVENT_HPP_ #include #endif #ifndef _THREAD_THREADCALLBACK_HPP_ #include #endif #ifndef _COMMON_PROFILE_HPP_ #include #endif #ifndef _NNTP_NNTPCLIENT_HPP_ #include #endif class YProxyThread : private MessageThread { public: YProxyThread(); virtual ~YProxyThread(); bool accept(Socket &socketControl,const String &host,const String &user,const String &password); protected: virtual void consoleMessage(const String &message); virtual bool stringHandler(const String &string); virtual void message(String message); virtual void message(Block &message); private: enum{AcceptMessage}; DWORD threadHandler(ThreadMessage &threadMessage); void thAccept(ThreadMessage &threadMessage); void sendConnectResponse(void); void handleModeReader(const String &string); void handleArticle(const String &string); void handleBody(const String &string); void handleGroup(const String &string); void handleHead(const String &string); void handleHelp(const String &string); void handleIHave(const String &string); void handleLast(const String &string); void handleList(const String &string); void handleNewGroups(const String &string); void handleNewNews(const String &string); void handleNext(const String &string); void handlePost(const String &string); void handleQuit(const String &string); void handleSlave(const String &string); void handleStat(const String &string); void handleListGroup(const String &string); void handleAuthInfoUser(const String &string); void handleAuthInfoPass(const String &string); void handleXOver(const String &string); bool isDebug(void)const; ThreadCallback mThreadHandler; Socket mSocketControl; Event mAcceptEvent; NNTPClient mNNTPClient; Profile mProfile; bool mIsDebug; }; inline bool YProxyThread::isDebug(void)const { return mIsDebug; } #endif