C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::net::octet_stream::policy Class Referenceabstract

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.
 

Detailed Description

Configures a transport object.

The default implementation simply forwards to the free functions of stream_socket.

Member Function Documentation

◆ accept()

virtual ptrdiff_t caf::net::octet_stream::policy::accept ( )
pure virtual

Convenience function that always returns 1.

Exists to make writing code against multiple policies easier by providing the same interface.


The documentation for this class was generated from the following files: