kopia lustrzana https://github.com/f4exb/sdrangel
Websocket spectrum: decode special addresses when setting from string
rodzic
05d878fa82
commit
07be58b0fb
|
@ -90,6 +90,17 @@ void WSSpectrum::getPeers(QList<QHostAddress>& hosts, QList<quint16>& ports) con
|
|||
}
|
||||
}
|
||||
|
||||
void WSSpectrum::setListeningAddress(const QString& address)
|
||||
{
|
||||
if (address == "127.0.0.1") {
|
||||
m_listeningAddress.setAddress(QHostAddress::LocalHost);
|
||||
} else if (address == "0.0.0.0") {
|
||||
m_listeningAddress.setAddress(QHostAddress::Any);
|
||||
} else {
|
||||
m_listeningAddress.setAddress(address);
|
||||
}
|
||||
}
|
||||
|
||||
QString WSSpectrum::getWebSocketIdentifier(QWebSocket *peer)
|
||||
{
|
||||
return QStringLiteral("%1:%2").arg(peer->peerAddress().toString(), QString::number(peer->peerPort()));
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
void closeSocket();
|
||||
bool socketOpened() const;
|
||||
void getPeers(QList<QHostAddress>& hosts, QList<quint16>& ports) const;
|
||||
void setListeningAddress(const QString& address) { m_listeningAddress.setAddress(address); }
|
||||
void setListeningAddress(const QString& address);
|
||||
void setPort(quint16 port) { m_port = port; }
|
||||
QHostAddress getListeningAddress() const;
|
||||
uint16_t getListeningPort() const;
|
||||
|
|
Ładowanie…
Reference in New Issue