<commit_before>#pragma once

#include <ostream>
#include <string>

namespace dariadb {
namespace net {

const std::string OK_ANSWER = "OK";
const std::string ERROR_ANSWER = "error";
const std::string HELLO_PREFIX = "hello";
const std::string DISCONNECT_PREFIX = "bye";
const std::string DISCONNECT_ANSWER = "bye";
const std::string PING_QUERY = "ping";
const std::string PONG_ANSWER = "pong";
const std::string WRITE_QUERY = "write";
const std::string READ_INTERVAL_QUERY = "read_interval";

enum class ClientState {
  CONNECT, // connection is beginning but a while not ended.
  WORK,    // normal client.
  DISCONNECTED
};

std::ostream &operator<<(std::ostream &stream, const ClientState &state);
}
}<commit_msg>net: NetData proto.<commit_after>#pragma once

#include <ostream>
#include <string>

namespace dariadb {
namespace net {

const std::string OK_ANSWER = "OK";
const std::string ERROR_ANSWER = "error";
const std::string HELLO_PREFIX = "hello";
const std::string DISCONNECT_PREFIX = "bye";
const std::string DISCONNECT_ANSWER = "bye";
const std::string PING_QUERY = "ping";
const std::string PONG_ANSWER = "pong";
const std::string WRITE_QUERY = "write";
const std::string READ_INTERVAL_QUERY = "read_interval";

enum class ClientState {
  CONNECT, // connection is beginning but a while not ended.
  WORK,    // normal client.
  DISCONNECTED
};

std::ostream &operator<<(std::ostream &stream, const ClientState &state);

/// before send big data, send to client "kind"' '"size"\n. then send 'data'.
struct NetData{
    int query_id;
    uint64_t size;
    std::string kind;
    uint8_t *data;
    ~NetData(){
        delete[] data;
    }
};

}
}
{'fraction_non_alphanumeric': 0.13208685162846803, 'fraction_numerical': 0.0018094089264173703, 'mean_word_length': 4.925, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '2822626', 'n_tokens_mistral': 553, 'n_tokens_neox': 551, 'n_words': 163}