forked from xaxaxa/workspace
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtmp.C
More file actions
36 lines (30 loc) · 867 Bytes
/
tmp.C
File metadata and controls
36 lines (30 loc) · 867 Bytes
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
#include <iostream>
#include <cplib/cplib.hpp>
#include <cplib/asyncsock.hpp>
#define NICK "hussain12"
#define USER "hussain12"
#define RNAME "hussain"
#define SERV "irc.freenode.net"
#define PORT 8001
using namespace xaxaxa;
using namespace Sockets;
int main()
{
int itr=0;
signal(SIGPIPE, SIG_IGN);
struct sigaction sa;
sa.sa_handler = SIG_IGN;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART; /* Restart functions if interrupted by handler */
sigaction(SIGHUP, &sa, NULL);
Socket s(AF_INET,SOCK_STREAM,0);
s.Connect({"89.16.176.16",PORT});
s.BeginRead()
stringstream ss;
string serv=SERV;
string port=PORT;
ss << "CAP LS\r\nNICK " << NICK << "\r\nUSER "<< USER << " " << USER << " " << "irc.freenode.org" << " :" << RNAME << "\r\n" << "CAP END\r\n";
string s=ss.str();
SocketManager* m=SocketManager::GetDefault();
m->EventLoop();
}