Browse Source

New example to publish a service

Girish Ramakrishnan 8 years ago
parent
commit
923f087970
2 changed files with 23 additions and 0 deletions
  1. 13 0
      examples/servicepublisher/main.cpp
  2. 10 0
      examples/servicepublisher/servicepublisher.pro

+ 13 - 0
examples/servicepublisher/main.cpp

@@ -0,0 +1,13 @@
+#include <QtGui>
+#include "qavahiservicepublisher.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication app(argc, argv);
+
+    QAvahiServicePublisher publisher;
+    publisher.publish("Test Service", "_tst._tcp", 1234, "auth=false");
+
+    return app.exec();
+}
+

+ 10 - 0
examples/servicepublisher/servicepublisher.pro

@@ -0,0 +1,10 @@
+TEMPLATE = app
+TARGET = 
+DEPENDPATH += .
+INCLUDEPATH += . ../..
+
+MOC_DIR=.moc
+OBJECTS_DIR=.obj
+
+include(../../libqavahi.pri)
+SOURCES += main.cpp