C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::policy::udp Struct Reference

Policy object for wrapping default UDP operations. More...

#include <udp.hpp>

Static Public Member Functions

static bool read_datagram (size_t &result, io::network::native_socket fd, void *buf, size_t buf_len, io::network::ip_endpoint &ep)
 Write a datagram containing buf_len bytes to fd addressed at the endpoint in sa with size sa_len.
 
static bool write_datagram (size_t &result, io::network::native_socket fd, void *buf, size_t buf_len, const io::network::ip_endpoint &ep)
 Reveice a datagram of up to len bytes.
 
static constexpr bool must_read_more (io::network::native_socket, size_t)
 Always returns false.
 

Detailed Description

Policy object for wrapping default UDP operations.

Member Function Documentation

◆ must_read_more()

static constexpr bool caf::policy::udp::must_read_more ( io::network::native_socket ,
size_t  )
staticconstexpr

Always returns false.

Native UDP I/O event handlers only rely on the socket buffer.

◆ read_datagram()

bool caf::policy::udp::read_datagram ( size_t & result,
io::network::native_socket fd,
void * buf,
size_t buf_len,
io::network::ip_endpoint & ep )
static

Write a datagram containing buf_len bytes to fd addressed at the endpoint in sa with size sa_len.

Returns true as long as no IO error occurs. The number of written bytes is stored in result and the sender is stored in ep.

◆ write_datagram()

bool caf::policy::udp::write_datagram ( size_t & result,
io::network::native_socket fd,
void * buf,
size_t buf_len,
const io::network::ip_endpoint & ep )
static

Reveice a datagram of up to len bytes.

Larger datagrams are truncated. Up to sender_len bytes of the receiver address is written into sender_addr. Returns true if no IO error occurred. The number of received bytes is stored in result (can be 0).


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