If we dynamically allocate a HTTP port, then attempt to reuse that port when Cantata restarts

This commit is contained in:
craig.p.drummond
2013-05-01 07:03:55 +00:00
committed by craig.p.drummond
parent 63ff21f740
commit 7230782891
6 changed files with 216 additions and 180 deletions

View File

@@ -26,12 +26,14 @@
#include <QTcpServer>
class QHostAddress;
class HttpSocket : public QTcpServer
{
Q_OBJECT
public:
HttpSocket(const QString &addr, quint16 p);
HttpSocket(const QString &addr, quint16 p, quint16 prevPort);
virtual ~HttpSocket() { }
void terminate();
@@ -39,6 +41,9 @@ public:
QString address() const { return ifaceAddress; }
QString configuredAddress() { return cfgAddress; }
private:
bool openPort(const QHostAddress &a, const QString &addr, quint16 p);
private Q_SLOTS:
void readClient();
void discardClient();