Hauptseite | Klassenhierarchie | Alphabetische Liste | Auflistung der Klassen | Auflistung der Dateien | Klassen-Elemente

TCPIPCommReceive.h

00001 //***************************************************************************** 00002 // project : ANALYTICA Class Library 00003 // part : Communication class for simple TCP/IP 00004 // file name : TCPIPCommReceive.h 00005 // version : $Revision: 1.3 $ 00006 // author : Udo Weber 00007 // platform : MS VC++ 6.0 00008 // 00009 //----------------------------------------------------------------------------- 00010 // Description: 00011 // ============= 00012 // implementation of the class CTCPIPComm to encapsulate simple TCP/IP 00013 // communications 00014 // Part : Receiving of messages 00015 // 00016 //----------------------------------------------------------------------------- 00017 // Revisionhistory: 00018 // $Log: TCPIPCommReceive.h,v $ 00019 // Revision 1.3 2001/07/12 14:36:00 AxelSchmidt 00020 // virtuelle Basis-Klasse CTraceObject hinzugefügt 00021 // 00022 // 03.07.2001 ASc Function InitializeClass added 00023 // 20.07.1998 UWe Some bug fixes 00024 // 20.04.1998 UWe first version 00025 //***************************************************************************** 00026 00027 #ifndef _TCPIPCommReceive_h 00028 #define _TCPIPCommReceive_h 00029 00030 //---- includes --------------------------------------------------------------- 00031 00032 #include <winsock.h> 00033 #include "TraceObject.h" 00034 00035 //---- defines/const ---------------------------------------------------------- 00036 00037 00038 //---- enums ------------------------------------------------------------------ 00039 00040 00041 //---- structs ---------------------------------------------------------------- 00042 00043 00044 //---- classes ---------------------------------------------------------------- 00045 00051 class CTCPIPCommReceive : virtual public CTraceObject 00052 { 00053 // public part 00054 public: 00055 00061 CTCPIPCommReceive( const long MaxRecvBufferLen = 8192 ); 00062 00064 virtual ~CTCPIPCommReceive(); 00065 00066 00067 // 00068 // public operations 00069 // 00070 00076 void Initialize( const SOCKET Socket ); 00077 00083 bool StartReceiving( void ); 00084 00090 int GetLastSocketError( void ) const; 00091 00097 bool Terminating( void ) const; 00098 00104 void Terminating( bool Terminating ); 00105 00106 00107 // protected part 00108 protected: 00109 00110 // 00111 // virtual callback functions 00112 // 00113 00120 virtual void Receive( void *pData, 00121 long DataLen ) = 0; 00122 00123 00129 virtual void RecvDisInd( void ) = 0; 00130 00131 00136 void InitializeClass( const long MaxRecvBufferLen ); 00137 00138 // private part 00139 private: 00140 00141 // 00142 // static member functions 00143 // 00149 static void RecvThread( CTCPIPCommReceive *pClass ); 00150 00151 // member definition 00152 SOCKET m_Socket; 00153 int m_LastSocketError; 00154 00155 DWORD m_ThreadID; 00156 00157 HANDLE m_ThreadHandle; 00158 HANDLE m_hEventTerminate; 00159 HANDLE m_hEventTerminateFinished; 00160 HANDLE m_hEventStartReceiving; 00161 00162 void *m_pRecvBuffer; 00163 long m_MaxRecvBufferLen; 00164 00165 bool m_Terminating; 00166 }; 00167 00168 00169 // 00170 // inline operations 00171 // 00172 00173 // get last socket error 00174 inline int CTCPIPCommReceive::GetLastSocketError( void ) const 00175 { 00176 return m_LastSocketError; 00177 } 00178 00179 00180 inline bool CTCPIPCommReceive::Terminating( void ) const 00181 { 00182 return m_Terminating; 00183 } 00184 00185 00186 inline void CTCPIPCommReceive::Terminating( bool Terminating ) 00187 { 00188 m_Terminating = Terminating; 00189 } 00190 00191 00192 00193 #endif // _TCPIPCommReceive_h

Erzeugt am Tue Mar 11 14:25:16 2008 für SchunkFPS von doxygen 1.3.7