TreeFrogFramework  1.18
tactionworker.h
Go to the documentation of this file.
1 #ifndef TACTIONWORKER_H
2 #define TACTIONWORKER_H
3 
4 #include <QThread>
5 #include <TActionContext>
6 
7 class THttpRequest;
9 class TEpollHttpSocket;
10 class QIODevice;
11 
12 
13 class T_CORE_EXPORT TActionWorker : public QThread, public TActionContext
14 {
15  Q_OBJECT
16 public:
17  TActionWorker(TEpollHttpSocket *socket, QObject *parent = 0);
18  virtual ~TActionWorker();
19 
20  static int workerCount();
21  static bool waitForAllDone(int msec);
22 
23 protected:
24  void run();
25  qint64 writeResponse(THttpResponseHeader &header, QIODevice *body);
26  void closeHttpSocket();
27 
28 private:
29  QByteArray httpRequest;
30  QString clientAddr;
31  TEpollHttpSocket *socket;
32 
35 };
36 
37 #endif // TACTIONWORKER_H
#define T_CORE_EXPORT
Definition: tglobal.h:81
#define T_DISABLE_COPY(Class)
Definition: tglobal.h:137
#define T_DISABLE_MOVE(Class)
Definition: tglobal.h:141
The TActionWorker class provides a thread context.
Definition: tactionworker.h:13
The THttpRequest class contains request information for HTTP.
Definition: thttprequest.h:38
The THttpResponseHeader class contains response header information for HTTP.
Definition: thttpheader.h:48