Files
@ 6699a898fbec
Branch filter:
Location: libtransport.git/examples/external_network_plugin/main.cpp - annotation
6699a898fbec
1.0 KiB
text/x-c++hdr
Working IRC room join + proper 110 status code sending
0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 | #include "transport/config.h"
#include "transport/transport.h"
#include "transport/usermanager.h"
#include "transport/logger.h"
#include "transport/sqlite3backend.h"
#include "transport/userregistration.h"
#include "transport/networkpluginserver.h"
#include "Swiften/EventLoop/SimpleEventLoop.h"
using namespace Transport;
int main(void)
{
Config config;
if (!config.load("sample.cfg")) {
std::cout << "Can't open sample.cfg configuration file.\n";
return 1;
}
Swift::SimpleEventLoop eventLoop;
Component transport(&eventLoop, &config, NULL);
Logger logger(&transport);
SQLite3Backend sql(&config);
logger.setStorageBackend(&sql);
if (!sql.connect()) {
std::cout << "Can't connect to database.\n";
}
UserManager userManager(&transport, &sql);
UserRegistration userRegistration(&transport, &userManager, &sql);
logger.setUserRegistration(&userRegistration);
logger.setUserManager(&userManager);
NetworkPluginServer plugin(&transport, &config, &userManager);
transport.connect();
eventLoop.run();
}
|