GlobalObjects
Loading...
Searching...
No Matches
TcpServerReceiver.h
Go to the documentation of this file.
1#ifndef INC_TCPSERVERRECEIVER_H
2#define INC_TCPSERVERRECEIVER_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 Server;
58 class AbstractMessage;
59 //---------------------------------------------------------------------------
81 {
82 protected:
83 //============== Attribute
84 //-----------------------------------------------------------------------
95 //-----------------------------------------------------------------------
96
97 //============== Konstruktoren
98 //-----------------------------------------------------------------------
109 //-----------------------------------------------------------------------
119 ServerReceiver( SOCKET );
120 //-----------------------------------------------------------------------
131 //-----------------------------------------------------------------------
141 ServerReceiver( TcpMain *, SOCKET, unsigned int );
142 //-----------------------------------------------------------------------
143
144 public:
145 //============== Konstruktoren
146 //-----------------------------------------------------------------------
164 ServerReceiver( Server * pParent, SOCKET Socket, unsigned int uiDataSize );
165 //-----------------------------------------------------------------------
176 //-----------------------------------------------------------------------
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 (__PTHREADS)).
218 \endif
219
220 \if german
221 Wenn der Thread beendet wirde, wird diese virtuale Methode aufgerufen.
222 \note Diese Methode gibt es nur, wenn mit POSIX-Threads kompiliert
223 (defined (__PTHREADS)).
224 \endif
225 */
226 virtual void cleanUp();
227 #endif
228 //-----------------------------------------------------------------------
255 virtual int acceptMessage( AbstractMessage * pTcpServerMessage ) override;
256 //-----------------------------------------------------------------------
287 virtual void generateNewTcpMessage( AbstractMessage *& prTcpServerMessage,
288 char * pszTransmitData,
289 unsigned int uiTransmitDataSize ) const override;
290 //-----------------------------------------------------------------------
323 virtual void generateNewTcpMessage( AbstractMessage *& prTcpServerMessage,
324 char * pszRawMsg,
325 unsigned int uiRawMsgSize,
326 unsigned int uiMessageID,
327 int iActionCode,
328 const std::string & rstrInfo ) const override;
329 //-----------------------------------------------------------------------
330
331 public:
332 //========== Methoden ========
333 //-----------------------------------------------------------------------
343 #if defined (__PTHREADS)
344 virtual int cancel();
345 #else
346 virtual void cancel() override;
347 #endif
348 //-----------------------------------------------------------------------
360 void setValid( bool bValid );
361 //-----------------------------------------------------------------------
362
363 private:
364 //============== Operatoren
365 //-----------------------------------------------------------------------
375 ServerReceiver & operator= ( const ServerReceiver & );
376 //-----------------------------------------------------------------------
377 };
378 //---------------------------------------------------------------------------
379} // namespace tcp
380//-----------------------------------------------------------------------------
381#endif
Header for DataReceiver.
Header for TcpMain
For each library, here 'TcpLib' there is a type file.
#define __tcp_export_dll
Definition TcpTypes.h:59
Base class for messages which can be sent, received and processed by the Tcp-classes.
Definition TcpMessage.h:97
Superclass for all TcpReceiver that communicate via a SOCKET and deliver their receive result,...
Definition TcpDataReceiver.h:85
A simple TCP server class, which should learn its know-how in the derived classes.
Definition TcpServer.h:268
Class that communicates with a Client via a SOCKET and delivers its receive result of type ServerMess...
Definition TcpServerReceiver.h:81
ServerReceiver(TcpMain *, SOCKET, unsigned int)
virtual void work() override
virtual void generateNewTcpMessage(AbstractMessage *&prTcpServerMessage, char *pszRawMsg, unsigned int uiRawMsgSize, unsigned int uiMessageID, int iActionCode, const std::string &rstrInfo) const override
ServerReceiver(Server *pParent, SOCKET Socket, unsigned int uiDataSize)
virtual void generateNewTcpMessage(AbstractMessage *&prTcpServerMessage, char *pszTransmitData, unsigned int uiTransmitDataSize) const override
ServerReceiver(const ServerReceiver &)
ServerReceiver(TcpMain *, SOCKET)
void setValid(bool bValid)
bool m_bValid
Definition TcpServerReceiver.h:94
virtual ~ServerReceiver()
virtual void cancel() override
virtual int acceptMessage(AbstractMessage *pTcpServerMessage) override
Superclass for Client and Server, which 'learns' its know-how in the derived classes.
Definition TcpMain.h:110
Definition TcpClient.h:55