19 bool listen(
const QHostAddress &address, quint16 port);
29 : m_tcpServer(nullptr)
37 bool couldBindToPort =
m_tcpServer->listen(address, port);
40 QObject::connect(
m_tcpServer, SIGNAL(newConnection()),
ttk_q(), SLOT(newConnection()));
46 return couldBindToPort;
79 #define STATUS_CODE(num, reason) STATUS_CODES.insert(num, reason);
114 STATUS_CODE(416,
"Requested Range Not Satisfiable")
143 return d->listen(address, port);
148 return listen(QHostAddress::Any, port);
QHttpServer * ttk_q() const
The class of the http response.
The class of the http connection.
void close()
Stop the server and listening for new connections.
bool listen(const QHostAddress &address, quint16 port)
#define STATUS_CODE(num, reason)
The class of the http request.
QHash< int, QString > STATUS_CODES
Maps status codes to string reason phrases.
The class of the http server.
The class of the http server private.
bool listen(const QHostAddress &address=QHostAddress::Any, quint16 port=80)
Start the server by bounding to the given address and port.
QHttpServer(QObject *parent=nullptr)
Construct a new HTTP Server.
#define TTK_INIT_PRIVATE(Class)
The class of the ttk private base.