GlobalObjects
Lade ...
Suche ...
Keine Treffer
TcpClientReceiver.h
gehe zur Dokumentation dieser Datei
1#ifndef INC_TCPCLIENTRECEIVER_H
2#define INC_TCPCLIENTRECEIVER_H
3//-----------------------------------------------------------------------------
43//-----------------------------------------------------------------------------
44#include "TcpTypes.h"
45#include "TcpDataReceiver.h"
46
47#include "TcpMain.h"
48
49#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
50 #include <winsock.h>
51#endif
52//-----------------------------------------------------------------------------
53namespace tcp
54{
55 //---------------------------------------------------------------------------
56 //Forwards
57 class AbstractMessage;
58 class Client;
59 //---------------------------------------------------------------------------
81 {
82 private:
83 //============== Attribute
84 //-----------------------------------------------------------------------
95 //-----------------------------------------------------------------------
96
97 protected:
98 //============== Konstruktoren
99 //-----------------------------------------------------------------------
110 //-----------------------------------------------------------------------
120 ClientReceiver( SOCKET );
121 //-----------------------------------------------------------------------
132 //-----------------------------------------------------------------------
142 ClientReceiver( TcpMain *, SOCKET, unsigned int );
143 //-----------------------------------------------------------------------
144
145 public:
146 //============== Konstruktoren
147 //-----------------------------------------------------------------------
165 ClientReceiver( Client * pParent, SOCKET Socket, unsigned int uiDataSize );
166 //-----------------------------------------------------------------------
177 //-----------------------------------------------------------------------
178
179 private:
180 //============== Copy-Konstruktor
181 //-----------------------------------------------------------------------
192 //-----------------------------------------------------------------------
193
194 protected:
195 //============== Methoden
196 //-----------------------------------------------------------------------
211 virtual void work() override;
212 //-----------------------------------------------------------------------
213 #if defined (__PTHREADS)
214 /*
215 \if english
216 When the thread ends, this virtual method is called.
217 \note This method only exists when compiled with POSIX threads (defined
218 (__PTHREADS)).
219 \endif
220
221 \if german
222 Wenn der Thread beendet wirde, wird diese virtuale Methode aufgerufen.
223 \note Diese Methode gibt es nur, wenn mit POSIX-Threads kompiliert
224 (defined (__PTHREADS)).
225 \endif
226 */
227 virtual void cleanUp();
228 #endif
229 //-----------------------------------------------------------------------
256 virtual int acceptMessage( AbstractMessage * pTcpMessage ) override;
257 //-----------------------------------------------------------------------
287 virtual void generateNewTcpMessage( AbstractMessage *& prTcpMessage,
288 char * pszTransmitData,
289 unsigned int uiTransmitDataSize ) const override;
290 //-----------------------------------------------------------------------
322 virtual void generateNewTcpMessage( AbstractMessage *& prTcpMessage,
323 char * pszRawMsg,
324 unsigned int uiRawMsgSize,
325 unsigned int uiMessageID,
326 int iActionCode,
327 const std::string & rstrInfo ) const override;
328 //-----------------------------------------------------------------------
329
330 public:
331 //========== Methoden ========
332 //-----------------------------------------------------------------------
342 #if defined (__PTHREADS)
343 virtual int cancel();
344 #else
345 virtual void cancel() override;
346 #endif
347 //-----------------------------------------------------------------------
359 bool connected() const;
360 //-------------------------------------------------------------------------
361
362 private:
363 //============== Operatoren
364 //-----------------------------------------------------------------------
374 ClientReceiver & operator= ( const ClientReceiver & );
375 //-----------------------------------------------------------------------
376 };
377 //---------------------------------------------------------------------------
378} // namespace tcp
379//-----------------------------------------------------------------------------
380#endif
Header für DataReceiver.
Header für TcpMain
Für jede Bibliothek, hier 'TcpLib' gibt es eine Typen-Datei.
#define __tcp_export_dll
Definition TcpTypes.h:59
Basisklasse für Nachrichten, welche von den Tcp-Klassen verschickt, empfangen und bearbeitet werden k...
Definition TcpMessage.h:97
Eine einfache TCP-Clientklasse, welche ihr KnowHow in den abgeleiteten Klassen lernen soll.
Definition TcpClient.h:199
Klasse, welche über ein SOCKET mit einem Server kommunizieret und ihr Empfangsergebnis vom Typ Messag...
Definition TcpClientReceiver.h:81
bool connected() const
ClientReceiver(const ClientReceiver &)
ClientReceiver(TcpMain *, SOCKET)
virtual void work() override
virtual void cancel() override
bool m_bHaveConnection
Definition TcpClientReceiver.h:94
virtual int acceptMessage(AbstractMessage *pTcpMessage) override
ClientReceiver(TcpMain *, SOCKET, unsigned int)
virtual ~ClientReceiver()
virtual void generateNewTcpMessage(AbstractMessage *&prTcpMessage, char *pszTransmitData, unsigned int uiTransmitDataSize) const override
ClientReceiver(Client *pParent, SOCKET Socket, unsigned int uiDataSize)
virtual void generateNewTcpMessage(AbstractMessage *&prTcpMessage, char *pszRawMsg, unsigned int uiRawMsgSize, unsigned int uiMessageID, int iActionCode, const std::string &rstrInfo) const override
Oberklasse für alle Receiver, welche über ein SOCKET kommunizieren und ihr Empfangsergebnis,...
Definition TcpDataReceiver.h:85
Oberklasse für Client sowie Server, welche ihr KnowHow in den abgeleiteten Klassen 'lernt'.
Definition TcpMain.h:110
Definition TcpClient.h:55