forked from jbagg/QtZeroConf
Merge pull request #23 from mzanetti/fix-multiple-browsers-on-android
only create one avahi server instance
This commit is contained in:
@ -55,7 +55,9 @@ public:
|
|||||||
avahi_server_config_init(&config);
|
avahi_server_config_init(&config);
|
||||||
config.publish_workstation = 0;
|
config.publish_workstation = 0;
|
||||||
|
|
||||||
server = avahi_server_new(poll, &config, serverCallback, this, &error);
|
if (!server) {
|
||||||
|
server = avahi_server_new(poll, &config, serverCallback, this, &error);
|
||||||
|
}
|
||||||
if (!server) {
|
if (!server) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -256,7 +258,7 @@ public:
|
|||||||
|
|
||||||
QZeroConf *pub;
|
QZeroConf *pub;
|
||||||
const AvahiPoll *poll;
|
const AvahiPoll *poll;
|
||||||
AvahiServer *server;
|
static AvahiServer *server;
|
||||||
AvahiServerConfig config;
|
AvahiServerConfig config;
|
||||||
AvahiSEntryGroup *group;
|
AvahiSEntryGroup *group;
|
||||||
AvahiSServiceBrowser *browser;
|
AvahiSServiceBrowser *browser;
|
||||||
@ -267,6 +269,7 @@ public:
|
|||||||
qint32 port;
|
qint32 port;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AvahiServer* QZeroConfPrivate::server = nullptr;
|
||||||
|
|
||||||
QZeroConf::QZeroConf(QObject *parent) : QObject (parent)
|
QZeroConf::QZeroConf(QObject *parent) : QObject (parent)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user