3#include <boost/asio.hpp>
18 using Socket = boost::asio::ip::tcp::socket;
38 boost::asio::const_buffers_1
data;
bool _ready
Is the queue allowed to start another asynchronous send?
boost::asio::ip::tcp::socket Socket
SocketSendQueue(SocketSendQueue const &)=delete
void sendCompleted()
Notifies the queue that the last asynchronous send operation has completed.
std::mutex _queueMutex
The mutex protecting access to the queue.
std::deque< SendItem > _itemQueue
The queue, containing items to asynchronously send using boost.asio.
SocketSendQueue()=default
void dispatch(std::shared_ptr< Socket > sock, boost::asio::const_buffers_1 data, std::function< void()> callback)
Put data in the queue, start processing the queue.
~SocketSendQueue()
If items are left in the queue upon destruction, something went really wrong.
SocketSendQueue & operator=(SocketSendQueue const &)=delete
void process()
This method can be called arbitrarily many times, but enough times to ensure the queue makes progress...
Main namespace of the precice library.
std::function< void()> callback
std::shared_ptr< Socket > sock
boost::asio::const_buffers_1 data