dpp::raii_socket
socket.h
socket socket dpp::raii_socket::fd fd dpp::raii_socket::fd

File descriptor.

dpp::raii_socket::raii_socket
(raii_socket &&)=delete
raii_socket
dpp::raii_socket::raii_socket
raii_socket &&

Non-movable.

dpp::raii_socket::raii_socket
(raii_socket &)=delete
raii_socket
dpp::raii_socket::raii_socket
raii_socket &

Non-copyable.

dpp::raii_socket::raii_socket
(raii_socket_type type=rst_udp)
raii_socket
dpp::raii_socket::raii_socket
raii_socket_type type rst_udp

Construct a socket. Calls socket() and returns a new file descriptor.

dpp::raii_socket::raii_socket
(socket plain_fd)
raii_socket
dpp::raii_socket::raii_socket
socket plain_fd

Convert an established fd to an raii_socket.

plain_fd

dpp::raii_socket::~raii_socket
()
~raii_socket
dpp::raii_socket::~raii_socket

Destructor Frees the socket by closing it.

socket socket dpp::raii_socket::accept () accept dpp::raii_socket::accept

Accept a pending connection on listening socket.

new connection file descriptor

bool bool dpp::raii_socket::bind (address_t address) bind dpp::raii_socket::bind address_t address

Bind socket to IP/port.

address

address to bind to

true on success

bool bool dpp::raii_socket::listen () listen dpp::raii_socket::listen

Listen on previously bound port.

true on success

raii_socket raii_socket dpp::raii_socket::operator= (raii_socket &&)=delete operator= dpp::raii_socket::operator= raii_socket &&

Non-movable.

raii_socket raii_socket dpp::raii_socket::operator= (raii_socket &)=delete operator= dpp::raii_socket::operator= raii_socket &

Non-copyable.

typename T
bool template DPP_EXPORT bool dpp::raii_socket::set_option< int > (int level, int name, T value) set_option dpp::raii_socket::set_option int level int name T value

Sets the value of a socket option.

T

type to set option for

level

The level at which to change the socket options

name

The option to change the value of

value

The value to set

True if set successfully

Allocates a dpp::socket, closing it on destruction.

dpp::raii_socket
fd
int
- dpp::raii_socket
  accept
- dpp::raii_socket
  bind
- dpp::raii_socket
  fd
- dpp::raii_socket
  listen
- dpp::raii_socket
  operator=
- dpp::raii_socket
  operator=
- dpp::raii_socket
  raii_socket
- dpp::raii_socket
  raii_socket
- dpp::raii_socket
  raii_socket
- dpp::raii_socket
  raii_socket
- dpp::raii_socket
  set_option
- dpp::raii_socket
  ~raii_socket