<commit_before>
/**
 * This file is part of the twosome package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */


#include <boost/thread.hpp>
#include <functional>

#include "kernel/net/chatclient.h"
#include "kernel/net/session.h"


int main(int argc __attribute__((unused)), char **argv __attribute__((unused)))
{
    /**
     * TODO: add options
     */

    boost::asio::io_service ioService;
    ChatClient client(ChatClient::Options("8765"), ioService);

    // TODO: Replace by std::bind()
    boost::thread clientThread(boost::bind(&boost::asio::io_service::run,
                                           &ioService));

    char message[Session::MAX_BUFFER_LENGTH];
    while (std::cin.getline(message, Session::MAX_BUFFER_LENGTH + 1)) {
        client.send(message);
    }

    client.close();
    clientThread.join();

    return EXIT_SUCCESS;
}<commit_msg>[client] add prompt "< "<commit_after>
/**
 * This file is part of the twosome package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */


#include <boost/thread.hpp>
#include <functional>

#include "kernel/net/chatclient.h"
#include "kernel/net/session.h"


bool writePrompt()
{
    std::cout << "< " << std::flush;
    return true;
}


int main(int argc __attribute__((unused)), char **argv __attribute__((unused)))
{
    /**
     * TODO: add options
     */

    boost::asio::io_service ioService;
    ChatClient client(ChatClient::Options("8765"), ioService);

    // TODO: Replace by std::bind()
    boost::thread clientThread(boost::bind(&boost::asio::io_service::run,
                                           &ioService));

    char message[Session::MAX_BUFFER_LENGTH];
    while (writePrompt()
           && std::cin.getline(message, Session::MAX_BUFFER_LENGTH + 1)) {
        client.send(message);
    }

    client.close();
    clientThread.join();

    return EXIT_SUCCESS;
}
{'fraction_non_alphanumeric': 0.14505283381364073, 'fraction_numerical': 0.004803073967339097, 'mean_word_length': 3.166, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1643691', 'n_tokens_mistral': 639, 'n_tokens_neox': 609, 'n_words': 154}