Hobrasoft httpd server
Embedded HTTP server for Qt and C++
Public Slots | Public Member Functions | List of all members
HobrasoftHttpd::HttpConnection Class Reference

One single connection to http server. More...

#include <httpconnection.h>

Inheritance diagram for HobrasoftHttpd::HttpConnection:

Public Slots

void close ()
 Closes the connection. More...
 

Public Member Functions

 HttpConnection (HttpServer *parent, QTcpSocket *socket)
 Constructor is called automatically when new request arrived.
 
HttpResponseresponse ()
 Returns new instance of class HttpResponse. More...
 
const HttpSettingssettings () const
 Returns pointer to settings used in the class. More...
 
HttpServerhttpServer () 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.
 
HttpRequestrequest () const
 
QVariant webStatus () const
 

Detailed Description

One single connection to http server.

Definition at line 30 of file httpconnection.h.

Member Function Documentation

◆ close

void HttpConnection::close ( )
slot

Closes the connection.

When the connection is closed, all descendant objects are destroyed.

Definition at line 86 of file httpconnection.cpp.

◆ httpServer()

HttpServer* HobrasoftHttpd::HttpConnection::httpServer ( ) const
inline

Returns pointer to http server.

See also
HttpServer

Definition at line 69 of file httpconnection.h.

◆ response()

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.

See also
HttpRequestHandler::response()

Definition at line 122 of file httpconnection.cpp.

◆ setPeerCertificate()

void HttpConnection::setPeerCertificate ( const QSslCertificate &  crt)

Sets peer's certificate.

Certificate is taken from HttpTcpServer class

Definition at line 65 of file httpconnection.cpp.

◆ settings()

const HttpSettings * HttpConnection::settings ( ) const

Returns pointer to settings used in the class.

See also
HttpSettings

Definition at line 51 of file httpconnection.cpp.


The documentation for this class was generated from the following files: