/** @file src/encode_server.cc
* @brief Class to describe a server to which we can send
* encoding work, and a class to implement such a server.
*/
/** @file src/encode_server.cc
* @brief Class to describe a server to which we can send
* encoding work, and a class to implement such a server.
*/
EncodeServer::EncodeServer (bool verbose, int num_threads)
#if !defined(RUNNING_ON_VALGRIND) || RUNNING_ON_VALGRIND == 0
: Server (ENCODE_FRAME_PORT)
EncodeServer::EncodeServer (bool verbose, int num_threads)
#if !defined(RUNNING_ON_VALGRIND) || RUNNING_ON_VALGRIND == 0
: Server (ENCODE_FRAME_PORT)
/** @param after_read Filled in with gettimeofday() after reading the input from the network.
* @param after_encode Filled in with gettimeofday() after encoding the image.
*/
/** @param after_read Filled in with gettimeofday() after reading the input from the network.
* @param after_encode Filled in with gettimeofday() after encoding the image.
*/
try {
auto socket = make_shared<Socket>();
socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), MAIN_SERVER_PRESENCE_PORT));
try {
auto socket = make_shared<Socket>();
socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), MAIN_SERVER_PRESENCE_PORT));
- socket->write (xml.length() + 1);
- socket->write ((uint8_t *) xml.c_str(), xml.length() + 1);
+ socket->write (xml.bytes() + 1);
+ socket->write ((uint8_t *) xml.c_str(), xml.bytes() + 1);
try {
auto socket = make_shared<Socket>();
socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), BATCH_SERVER_PRESENCE_PORT));
try {
auto socket = make_shared<Socket>();
socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), BATCH_SERVER_PRESENCE_PORT));
- socket->write (xml.length() + 1);
- socket->write ((uint8_t *) xml.c_str(), xml.length() + 1);
+ socket->write (xml.bytes() + 1);
+ socket->write ((uint8_t *) xml.c_str(), xml.bytes() + 1);