<commit_before>#include "include/zmqio.h"

//-------------------------Inbound ZMQ Admin----------------------------------//

//Constructor & Destructor
Zmqi::Zmqi(zmq::context_t &context)
{
  zmqi = new zmq::socket_t (context, ZMQ_REP);
}

Zmqi::~Zmqi()
{
  delete zmqi;
}

//Bind the inbound socket
void Zmqi::bind(std::string conn_str)
{
  zmqi->bind(conn_str);
}

//Recieve an inbound message
std::string Zmqi::recv()
{
  zmq::message_t request;

  //  Wait for next request from client
  zmqi->recv (&request);
  logging->info("ZMQ: Inbound Request Recieved");

  //Convert the OMQ message into a string to be passed
  std::string req_string;
  req_string = hexDump (request);
  logging->debug(req_string);
  return req_string;
}

//Send a response
void Zmqi::send(const char * msg, int msg_size)
{
  //  Send reply back to client
  zmq::message_t reply (msg_size);

  //Prepare return data
  memcpy (reply.data (), msg, msg_size);
  //Send the response
  zmqi->send (reply);
  logging->info("ZMQ: Inbound Response Sent");
  logging->debug(msg);
}

//Send a string response
void Zmqi::send_str(std::string msg)
{
  const char * msg_cstr = msg.c_str();
  send(msg_cstr, msg.size());
}

//-------------------------Outbound ZMQ Admin---------------------------------//

//Constructor & Destructor
Zmqo::Zmqo(zmq::context_t &context)
{
  zmqo = new zmq::socket_t (context, ZMQ_REQ);
}

Zmqo::~Zmqo()
{
  delete zmqo;
}

//Connect to the Socket
void Zmqo::connect(std::string conn_str)
{
  zmqo->connect(conn_str);
}

//Send a message
void Zmqo::send(const char * msg, int msg_size)
{
  //Set up the message to go out on 0MQ
  zmq::message_t req (msg_size);
  memcpy (req.data (), msg, msg_size);

  //Send the message
  zmqo->send (req);

  logging->info("ZMQ: Outbound Message Sent");
  logging->debug(msg);
}

//Send a string message
void Zmqo::send_str(std::string &msg) {<commit_msg>Fixes<commit_after>#include "include/zmqio.h"

//-------------------------Inbound ZMQ Admin----------------------------------//

//Constructor & Destructor
Zmqi::Zmqi(zmq::context_t &context)
{
  zmqi = new zmq::socket_t (context, ZMQ_REP);
}

Zmqi::~Zmqi()
{
  delete zmqi;
}

//Bind the inbound socket
void Zmqi::bind(std::string conn_str)
{
  zmqi->bind(conn_str);
}

//Recieve an inbound message
std::string Zmqi::recv()
{
  zmq::message_t request;

  //  Wait for next request from client
  zmqi->recv (&request);
  logging->info("ZMQ: Inbound Request Recieved");

  //Convert the OMQ message into a string to be passed
  std::string req_string;
  req_string = hexDump (request);
  logging->debug(req_string);
  return req_string;
}

//Send a response
void Zmqi::send(const char * msg, int msg_size)
{
  //  Send reply back to client
  zmq::message_t reply (msg_size);

  //Prepare return data
  memcpy (reply.data (), msg, msg_size);
  //Send the response
  zmqi->send (reply);
  logging->info("ZMQ: Inbound Response Sent");
  logging->debug(msg);
}

//Send a string response
void Zmqi::send_str(std::string msg)
{
  const char * msg_cstr = msg.c_str();
  send(msg_cstr, msg.size());
}

//-------------------------Outbound ZMQ Admin---------------------------------//

//Constructor & Destructor
Zmqo::Zmqo(zmq::context_t &context)
{
  zmqo = new zmq::socket_t (context, ZMQ_REQ);
}

Zmqo::~Zmqo()
{
  delete zmqo;
}

//Connect to the Socket
void Zmqo::connect(std::string conn_str)
{
  zmqo->connect(conn_str);
}

//Send a message
void Zmqo::send(const char * msg, int msg_size)
{
  //Set up the message to go out on 0MQ
  zmq::message_t req (msg_size);
  memcpy (req.data (), msg, msg_size);

  //Send the message
  zmqo->send (req);

  logging->info("ZMQ: Outbound Message Sent");
  logging->debug(msg);
}

//Send a string message
void Zmqo::send_str(std::string msg) {
{'fraction_non_alphanumeric': 0.2047808764940239, 'fraction_numerical': 0.0005312084993359894, 'mean_word_length': 3.0364415862808145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, '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': '3772841', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1358, 'n_words': 350}