<commit_before>
#include <unistd.h>
#include <QCoreApplication>
#include "main.h"

TestWs::TestWs() : QObject(0), _client(Q_NULLPTR) {
    _client = new BOZ::bozWebsocketClient(this);
    connect(_client, SIGNAL(connected()), this, SLOT(onConnected()), Qt::DirectConnection);
    connect(_client, SIGNAL(disconnected()), this, SLOT(onDisconnected()), Qt::DirectConnection);
    connect(_client, SIGNAL(readyRead()), this, SLOT(onData()), Qt::DirectConnection);
    }

TestWs::~TestWs() {
    delete _client;
    }

void TestWs::connection() {
    quint16 port=1234;
    QString s("127.0.0.1");
    QHostAddress address(s);
    
    _client->connectToHost(address, port);    
}

void TestWs::disconnection() {
    _client->disconnectFromHost();    
}

void TestWs::onConnected() {
    qDebug("%s", __PRETTY_FUNCTION__);
}

void TestWs::onDisconnected() {
    qDebug("%s", __PRETTY_FUNCTION__);
}

void TestWs::onData() {
//    qDebug("%s", __PRETTY_FUNCTION__);
    QByteArray data=_client->read();
    qDebug("%s: rx %d '%s'", __PRETTY_FUNCTION__, data.size(), data.constData());

}<commit_msg>write now tested, and functional<commit_after>
#include <unistd.h>
#include <QCoreApplication>
#include "main.h"

TestWs::TestWs() : QObject(0), _client(Q_NULLPTR) {
    _client = new BOZ::bozWebsocketClient(this);
    connect(_client, SIGNAL(connected()), this, SLOT(onConnected()), Qt::DirectConnection);
    connect(_client, SIGNAL(disconnected()), this, SLOT(onDisconnected()), Qt::DirectConnection);
    connect(_client, SIGNAL(readyRead()), this, SLOT(onData()), Qt::DirectConnection);
    }

TestWs::~TestWs() {
    delete _client;
    }

void TestWs::connection() {
    quint16 port=1234;
    QString s("127.0.0.1");
    QHostAddress address(s);
    
    _client->connectToHost(address, port);    
}

void TestWs::disconnection() {
    _client->disconnectFromHost();    
}

void TestWs::onConnected() {
    qDebug("%s", __PRETTY_FUNCTION__);
}

void TestWs::onDisconnected() {
    qDebug("%s", __PRETTY_FUNCTION__);
}

void TestWs::onData() {
//    qDebug("%s", __PRETTY_FUNCTION__);
    QByteArray data=_client->read();
    qDebug("%s: rx %d '%s'", __PRETTY_FUNCTION__, data.size(), data.constData());

    if(!strncmp(data.constData(), "7", 1)) {
        qDebug("%s: send reset", __PRETTY_FUNCTION__);
        _client->write("reset\n", 6);
    }

}
{'fraction_non_alphanumeric': 0.17857142857142858, 'fraction_numerical': 0.012329931972789115, 'mean_word_length': 4.795566502463054, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 14, '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': '2717887', 'n_tokens_mistral': 845, 'n_tokens_neox': 821, 'n_words': 143}