C++ Actor Framework 1.0.0
|
Configures a transport object. More...
#include <policy.hpp>
Public Member Functions | |
virtual stream_socket | handle () const =0 |
Returns the handle for the managed socket. | |
virtual ptrdiff_t | read (byte_span buf)=0 |
Reads data from the socket into the buffer. | |
virtual ptrdiff_t | write (const_byte_span buf)=0 |
Writes data from the buffer to the socket. | |
virtual errc | last_error (ptrdiff_t)=0 |
Returns the last socket error on this thread. | |
virtual ptrdiff_t | connect ()=0 |
Checks whether connecting a non-blocking socket was successful. | |
virtual ptrdiff_t | accept ()=0 |
Convenience function that always returns 1. | |
virtual size_t | buffered () const noexcept=0 |
Returns the number of bytes that are buffered internally and available for immediate read. | |
Configures a transport object.
The default implementation simply forwards to the free functions of stream_socket.
|
pure virtual |
Convenience function that always returns 1.
Exists to make writing code against multiple policies easier by providing the same interface.