blob: 201cb6184bea87f99959b94eb1102efe85c48461 (
plain)
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
32
33
34
35
36
37
|
#include "pn_core.h"
#include "pn_session.h"
#include <signal.h>
static GMainLoop *loop;
static void
signal_handler(int signal)
{
g_main_loop_quit(loop);
}
int main(int argc, char *argv[])
{
struct pn_session *session;
g_type_init();
pn_core_init();
signal(SIGINT, signal_handler);
loop = g_main_loop_new(NULL, FALSE);
session = pn_session_new(argv[1], argv[2]);
pn_session_connect(session, "messenger.hotmail.com", 1863);
g_message("connecting");
g_main_loop_run(loop);
pn_session_free(session);
g_main_loop_unref(loop);
pn_core_deinit();
return 0;
}
|