QtWebApp
httplistener.h
Go to the documentation of this file.
1 
6 #ifndef HTTPLISTENER_H
7 #define HTTPLISTENER_H
8 
9 #include <QTcpServer>
10 #include <QSettings>
11 #include <QBasicTimer>
12 #include "httpglobal.h"
13 #include "httpconnectionhandler.h"
14 #include "httpconnectionhandlerpool.h"
15 #include "httprequesthandler.h"
16 
17 namespace stefanfrings {
18 
57 class DECLSPEC HttpListener : public QTcpServer {
58  Q_OBJECT
59  Q_DISABLE_COPY(HttpListener)
60 public:
61 
75  HttpListener(const QSettings* settings, HttpRequestHandler* requestHandler, QObject* parent=nullptr);
76 
78  virtual ~HttpListener();
79 
83  void listen();
84 
89  void close();
90 
91 protected:
92 
94  void incomingConnection(tSocketDescriptor socketDescriptor);
95 
96 private:
97 
99  const QSettings* settings;
100 
102  HttpRequestHandler* requestHandler;
103 
106 
107 signals:
108 
114  void handleConnection(tSocketDescriptor socketDescriptor);
115 
116 };
117 
118 } // end of namespace
119 
120 #endif // HTTPLISTENER_H
Listens for incoming TCP connections and and passes all incoming HTTP requests to your implementation...
Definition: httplistener.h:57
void handleConnection(tSocketDescriptor socketDescriptor)
Sent to the connection handler to process a new incoming connection.
The request handler generates a response for each HTTP request.
qintptr tSocketDescriptor
Alias type definition, for compatibility to different Qt versions.