From 8b9e630718d4abcf2677448120cc80c1791a444e Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Mon, 23 Aug 2010 12:37:34 +0000 Subject: add an example for XMPP server --- examples/example_8_server/example_8_server.pro | 8 ++++++ examples/example_8_server/main.cpp | 37 ++++++++++++++++++++++++++ examples/example_8_server/xmppServer.cpp | 29 ++++++++++++++++++++ examples/example_8_server/xmppServer.h | 31 +++++++++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 examples/example_8_server/example_8_server.pro create mode 100644 examples/example_8_server/main.cpp create mode 100644 examples/example_8_server/xmppServer.cpp create mode 100644 examples/example_8_server/xmppServer.h (limited to 'examples/example_8_server') 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 + +#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&); +}; + -- cgit v1.2.3