--- innwebd/base.h 2004/07/03 13:56:04 1.2 +++ innwebd/base.h 2008/04/11 17:14:49 1.8 @@ -1,14 +1,10 @@ /*******************************************************/ /* */ -/* LeafOK Innd */ -/* Copyright (C) LeafOK.com, 2003-2004 */ +/* LeafOK Innbbsd */ /* */ -/* Programmed by Leaf */ -/* E-mail:leaf@leafok.com QQ:6049044 */ +/* Copyright (C) LeafOK.com, 2003-2008 */ /* */ -/* http://bbs.leafok.com */ -/* http://bbs.leafok.net */ -/* http://bbs.fenglin.info */ +/* http://www.leafok.com */ /* */ /*******************************************************/ @@ -28,7 +24,7 @@ public: int end(void); inline bool IsRunning(void) { - return this->running; + return (this->running && this->IsThreadActive()); } inline base* GetParentThread(void) { @@ -47,6 +43,7 @@ public: this->p_ThreadPool = p_ThreadPool; } protected: + ULONG ulMainThreadId; base* p_ParentThread; thread_pool* p_ThreadPool; SOCKET s; @@ -72,14 +69,15 @@ protected: virtual int s_connect(const char* hostname, unsigned int port) = 0; virtual int s_close(void) = 0; int s_send(const char* in_str, bool auto_endl = true); - int s_receive(CString& out_str, const char* end_str="\r\n"); - int s_exec(const char* in_str, CString& out_str, const char* end_str="\r\n"); + int s_receive(CString& out_str, char end_str[] = "\r"); + int s_exec(const char* in_str, CString& out_str, char end_str[] = "\r"); virtual bool IsShutdown(void); virtual int Shutdown(void); virtual int Startup(void); virtual int w_call() = 0; private: - HANDLE hThread; static DWORD Thread(LPVOID pParam); +public: + bool IsThreadActive(void); };