Add ref-counted buffer byte_slice. Currently used for sending TCP data.

This commit is contained in:
Lee Clagett 2019-05-11 11:38:35 -04:00
parent cdfa2e58df
commit bdfc63ae4d
13 changed files with 882 additions and 153 deletions

View file

@ -149,11 +149,11 @@ namespace
}
// Implement epee::net_utils::i_service_endpoint interface
virtual bool do_send(const void* ptr, size_t cb)
virtual bool do_send(epee::byte_slice message)
{
m_send_counter.inc();
boost::unique_lock<boost::mutex> lock(m_mutex);
m_last_send_data.append(reinterpret_cast<const char*>(ptr), cb);
m_last_send_data.append(reinterpret_cast<const char*>(message.data()), message.size());
return m_send_return;
}