Hobrasoft httpd server
Embedded HTTP server for Qt and C++
|
One single connection to http server. More...
#include <httpconnection.h>
Public Slots | |
void | close () |
Closes the connection. More... | |
Public Member Functions | |
HttpConnection (HttpServer *parent, QTcpSocket *socket) | |
Constructor is called automatically when new request arrived. | |
HttpResponse * | response () |
Returns new instance of class HttpResponse. More... | |
const HttpSettings * | settings () const |
Returns pointer to settings used in the class. More... | |
HttpServer * | httpServer () const |
Returns pointer to http server. More... | |
QTcpSocket * | socket () const |
Returns the socket. | |
bool | verified () const |
Returns true if the client is verified using SSL. | |
void | setVerified (bool x) |
Sets the flag verified. | |
void | setPeerCertificate (const QSslCertificate &) |
Sets peer's certificate. More... | |
QString | commonName () const |
Returns CommonName field from certificate. | |
const QSslCertificate | peerCertificate () const |
Returns Peer's certificate. | |
bool | isConnected () const |
Returns true if the connection is in connected state. | |
void | setTimeout (int x) |
QHostAddress | peerAddress () const |
Returns peer's host address. | |
HttpRequest * | request () const |
QVariant | webStatus () const |
One single connection to http server.
Definition at line 30 of file httpconnection.h.
|
slot |
Closes the connection.
When the connection is closed, all descendant objects are destroyed.
Definition at line 86 of file httpconnection.cpp.
|
inline |
HttpResponse * HttpConnection::response | ( | ) |
Returns new instance of class HttpResponse.
The returned class is connected with opened socket. Method is used in specialized handlers derived from HttpRequestHandler where it is demanded to make multiple responses to one request. This typically happened in HTML5 event streams. Derived class should call this method indirectly using HttpRequestHandler::response().
Timeout timer is restarted when this method is called.
Definition at line 122 of file httpconnection.cpp.
void HttpConnection::setPeerCertificate | ( | const QSslCertificate & | crt | ) |
Sets peer's certificate.
Certificate is taken from HttpTcpServer class
Definition at line 65 of file httpconnection.cpp.
const HttpSettings * HttpConnection::settings | ( | ) | const |
Returns pointer to settings used in the class.
Definition at line 51 of file httpconnection.cpp.