aboutsummaryrefslogtreecommitdiff
path: root/examples/example_8_server
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-08-23 12:37:34 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-08-23 12:37:34 +0000
commit8b9e630718d4abcf2677448120cc80c1791a444e (patch)
tree337e009fc032273d043d4285ca48471ec9d629ff /examples/example_8_server
parent215be02a36812acf112fe82ea03ca5a09392ad90 (diff)
downloadqxmpp-8b9e630718d4abcf2677448120cc80c1791a444e.tar.gz
add an example for XMPP server
Diffstat (limited to 'examples/example_8_server')
-rw-r--r--examples/example_8_server/example_8_server.pro8
-rw-r--r--examples/example_8_server/main.cpp37
-rw-r--r--examples/example_8_server/xmppServer.cpp29
-rw-r--r--examples/example_8_server/xmppServer.h31
4 files changed, 105 insertions, 0 deletions
diff --git a/examples/example_8_server/example_8_server.pro b/examples/example_8_server/example_8_server.pro
new file mode 100644
index 00000000..b3a84029
--- /dev/null
+++ b/examples/example_8_server/example_8_server.pro
@@ -0,0 +1,8 @@
+include(../examples.pri)
+
+TARGET = example_8_server
+
+SOURCES += main.cpp \
+ xmppServer.cpp
+
+HEADERS += xmppServer.h
diff --git a/examples/example_8_server/main.cpp b/examples/example_8_server/main.cpp
new file mode 100644
index 00000000..ad826007
--- /dev/null
+++ b/examples/example_8_server/main.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2008-2010 The QXmpp developers
+ *
+ * Author:
+ * Jeremy Lainé
+ *
+ * Source:
+ * http://code.google.com/p/qxmpp
+ *
+ * This file is a part of QXmpp library.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ */
+
+#include <QtCore/QCoreApplication>
+
+#include "QXmppLogger.h"
+#include "xmppServer.h"
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+
+ xmppServer server;
+ server.setDomain("example.com");
+ server.listenForClients();
+ return a.exec();
+}
diff --git a/examples/example_8_server/xmppServer.cpp b/examples/example_8_server/xmppServer.cpp
new file mode 100644
index 00000000..3d594673
--- /dev/null
+++ b/examples/example_8_server/xmppServer.cpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2008-2010 The QXmpp developers
+ *
+ * Author:
+ * Jeremy Lainé
+ *
+ * Source:
+ * http://code.google.com/p/qxmpp
+ *
+ * This file is a part of QXmpp library.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ */
+
+#include "xmppServer.h"
+
+void xmppServer::handleStanza(QXmppStream*, const QDomElement&)
+{
+}
+
diff --git a/examples/example_8_server/xmppServer.h b/examples/example_8_server/xmppServer.h
new file mode 100644
index 00000000..4da66b81
--- /dev/null
+++ b/examples/example_8_server/xmppServer.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2008-2010 The QXmpp developers
+ *
+ * Author:
+ * Jeremy Lainé
+ *
+ * Source:
+ * http://code.google.com/p/qxmpp
+ *
+ * This file is a part of QXmpp library.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ */
+
+#include "QXmppServer.h"
+
+class xmppServer : public QXmppServer
+{
+private:
+ void handleStanza(QXmppStream*, const QDomElement&);
+};
+