<commit_before>/*
** main-client.cpp
** Login : <<EMAIL>>
** Started on  Tue Jan  3 13:52:00 2012 <NAME>
** $Id$
**
** Author(s):
**  - <NAME> <<EMAIL>>
**
** Copyright (C) 2012 <NAME>
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <iostream>

#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <event2/util.h>
#include <event2/event.h>
#include <event2/buffer.h>
#include <event2/bufferevent.h>
#include <boost/thread.hpp>

#include "transport-client.hpp"

class RemoteService : public TransportClientDelegate {
public:
  RemoteService() {
    tc = new TransportClient("127.0.0.1", 12345);
    tc->setDelegate(this);

    boost::thread transportThread(TransportClient::launch, tc);
    sleep(5);

    tc->send("totot\n");
    transportThread.join();
    delete tc;
  }

  virtual void onConnected()
  {
    std::cout << "connected" << std::endl;
  }

  virtual void onWrite()
  {
    std::cout << "written" << std::endl;
  }

  virtual void onRead()
  {
    std::cout << "read" << std::endl;
  }

private:
  TransportClient *tc;
};

int main(int argc, char *argv[])
{
  RemoteService rs;
  return 0;

}<commit_msg>cleanup<commit_after>/*
** main-client.cpp
** Login : <<EMAIL>>
** Started on  Tue Jan  3 13:52:00 2012 <NAME>
** $Id$
**
** Author(s):
**  - <NAME> <<EMAIL>>
**
** Copyright (C) 2012 <NAME>
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <iostream>

#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <event2/util.h>
#include <event2/event.h>
#include <event2/buffer.h>
#include <event2/bufferevent.h>
#include <boost/thread.hpp>

#include "transport-client.hpp"

class RemoteService : public TransportClientDelegate {
public:
  RemoteService() {
    tc = new TransportClient("127.0.0.1", 12345);
    tc->setDelegate(this);
    thd = boost::thread(TransportClient::launch, tc);
  }

  ~RemoteService() {
    delete tc;
  }

  void call() {
    sleep(1);
    tc->send("totot\n");
    //thd.join();
  }

  virtual void onConnected()
  {
    std::cout << "connected" << std::endl;
  }

  virtual void onWrite()
  {
    std::cout << "written" << std::endl;
  }

  virtual void onRead()
  {
    std::cout << "read" << std::endl;
  }

private:
  TransportClient *tc;
  boost::thread    thd;
};

int main(int argc, char *argv[])
{
  RemoteService rs;
  rs.call();
  return 0;

}
{'fraction_non_alphanumeric': 0.13923705722070845, 'fraction_numerical': 0.02561307901907357, 'mean_word_length': 3.8816489361702127, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3942619', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1159, 'n_words': 410}