~singpolyma/biboumi

ref: bf7b05ef72bbdac97704d262ddfe418908267535 biboumi/src/main.cpp -rw-r--r-- 758 bytes
bf7b05ef — Florent Le Coz Implement the Bridge class to translate between the two protocols 10 years ago
                                                                                
87aaacdb Florent Le Coz
bf7b05ef Florent Le Coz
64c1b28c Florent Le Coz
bf7b05ef Florent Le Coz
64c1b28c Florent Le Coz
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <irc/irc_client.hpp>
#include <xmpp/xmpp_component.hpp>
#include <network/poller.hpp>

#include <xmpp/xmpp_parser.hpp>
#include <xmpp/xmpp_stanza.hpp>

#include <memory>

#include <xmpp/jid.hpp>
#include <irc/iid.hpp>

#include <iostream>

int main()
{
  Poller p;
  // Now I'm the bridge, creating an ircclient because needed.
  std::shared_ptr<IrcClient> c = std::make_shared<IrcClient>();
  p.add_socket_handler(c);
  std::shared_ptr<IrcClient> d = std::make_shared<IrcClient>();
  p.add_socket_handler(d);
  std::shared_ptr<IrcClient> e = std::make_shared<IrcClient>();
  p.add_socket_handler(e);
  c->connect("localhost", "7877");
  d->connect("localhost", "7878");
  e->connect("localhost", "7879");
  while (true)
    p.poll();
  return 0;
}