-
Notifications
You must be signed in to change notification settings - Fork 1
/
client_main_xmpp.cpp
24 lines (21 loc) · 979 Bytes
/
client_main_xmpp.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "TCP_socket.hpp"
#include <iostream>
int main()
{
TCPSocketSpace::TCPSocketClient client_socket;
client_socket.connet("36.255.68.139", 5222);
client_socket.send("<?xml version='1.0'?> <stream:stream to='ckotha.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>");
client_socket.receive();
std::cout << "******************\n";
client_socket.send("<iq type='set' id='auth2'><query xmlns='jabber:iq:auth'><username>matin1</username><password>****</password><resource>jingle</resource></query></iq>");
client_socket.receive();
client_socket.send("<message to='[email protected]'><subject>testing!</subject><body>hi from c++ client</body></message>");
// client_socket.send("<body>Hello</body>");
// client_socket.send("</message>");
// client_socket.receive();
client_socket.receive();
// client_socket.send("</stream:stream>");
// char buffer[1024] = {0};
// client_socket.send(buffer);
return 0;
}