~ubuntu-branches/ubuntu/wily/ginkgocadx/wily-proposed

« back to all changes in this revision

Viewing changes to src/cadxcore/endpoint/eptest/irc.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Tille
  • Date: 2011-05-02 08:09:26 UTC
  • Revision ID: james.westby@ubuntu.com-20110502080926-bql5wep49c7hg91t
Tags: upstream-2.4.1.1
ImportĀ upstreamĀ versionĀ 2.4.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Created:20030726
 
2
// By Jeff Connelly
 
3
 
 
4
// IRC
 
5
 
 
6
#include <iostream>
 
7
 
 
8
#include "endpoint.h"
 
9
 
 
10
#ifdef _DEBUG
 
11
#define new DEBUG_NEW
 
12
#undef THIS_FILE
 
13
static char THIS_FILE[] = __FILE__;
 
14
#endif
 
15
 
 
16
int main()
 
17
{
 
18
    Endpoint ep(TCP | CLIENT, "[127.0.0.1]:6667");
 
19
    string str;
 
20
 
 
21
    ep.Write("NICK jeff2\015\012");
 
22
    ep.Write("USER blah blah blah :blahs\015\012");
 
23
 
 
24
    while(ep.Read(-200, str)) 
 
25
    {
 
26
        std::cout << str;
 
27
        if (str.find("376") != string::npos)    // End of /MOTD
 
28
        {
 
29
            ep.Write("MODE jeff2 +ix\015\012");
 
30
            ep.Write("PRIVMSG jeff :hello world\015\012");
 
31
        }
 
32
        str = "";
 
33
    }
 
34
 
 
35
    return 0;
 
36
}