• WebServerClient
  • WebServerClient Class

    (nymeaserver::WebServerClient)

    This class represents a client the web server for nymead. More...

    Header: #include <WebServerClient>
    Inherits:

    Public Functions

    WebServerClient(const QHostAddress & address, QObject * parent = nullptr)
    void addConnection(QSslSocket * socket)
    QHostAddress address() const
    QList<QSslSocket *> connections()
    void removeConnection(QSslSocket * socket)
    void resetTimout(QSslSocket * socket)

    Detailed Description

    This class represents a client the web server for nymead.

    The WebServerClient represents a client for the nymea WebServer. Each client can have up to 50 connections and each connection will timeout after 12 seconds if the connection will not be used.

    If all connections of a WebServerClient are closed, the client will be removed from system.

    See also WebServer.

    Member Function Documentation

    WebServerClient::WebServerClient(const QHostAddress & address, QObject * parent = nullptr)

    Constructs a WebServerClient with the given address and parent.

    void WebServerClient::addConnection(QSslSocket * socket)

    Adds a new connection (socket) to this WebServerClient. A WebServerClient can have up to 50 connecections. The connection will timout and closed if the client does not use the connection for 12 seconds.

    QHostAddress WebServerClient::address() const

    Returns the address of this WebServerClient.

    QList<QSslSocket *> WebServerClient::connections()

    Returns the list of connections (sockets) of this WebServerClient.

    void WebServerClient::removeConnection(QSslSocket * socket)

    Removes a connection the given socket from the connection list of this WebServerClient.

    void WebServerClient::resetTimout(QSslSocket * socket)

    Resets the connection timeout for the given socket. If the socket will not be used for 12 seconds the connection will be closed.