Allocates a dpp::socket, closing it on destruction.  
 More...
#include <socket.h>
Allocates a dpp::socket, closing it on destruction. 
 
◆ raii_socket() [1/4]
Construct a socket. Calls socket() and returns a new file descriptor. 
 
 
◆ raii_socket() [2/4]
      
        
          | dpp::raii_socket::raii_socket  | 
          ( | 
          socket  | 
          plain_fd | ) | 
           | 
        
      
 
Convert an established fd to an raii_socket. 
- Parameters
 - 
  
  
 
 
 
◆ raii_socket() [3/4]
◆ raii_socket() [4/4]
◆ ~raii_socket()
      
        
          | dpp::raii_socket::~raii_socket  | 
          ( | 
           | ) | 
           | 
        
      
 
Destructor Frees the socket by closing it. 
 
 
◆ accept()
      
        
          | socket dpp::raii_socket::accept  | 
          ( | 
           | ) | 
           | 
        
      
 
Accept a pending connection on listening socket. 
- Returns
 - new connection file descriptor 
 
 
 
◆ bind()
      
        
          | bool dpp::raii_socket::bind  | 
          ( | 
          address_t  | 
          address | ) | 
           | 
        
      
 
Bind socket to IP/port. 
- Parameters
 - 
  
    | address | address to bind to  | 
  
   
- Returns
 - true on success 
 
 
 
◆ listen()
      
        
          | bool dpp::raii_socket::listen  | 
          ( | 
           | ) | 
           | 
        
      
 
Listen on previously bound port. 
- Returns
 - true on success 
 
 
 
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ set_option()
template<typename T > 
      
        
          | bool dpp::raii_socket::set_option  | 
          ( | 
          int  | 
          level,  | 
        
        
           | 
           | 
          int  | 
          name,  | 
        
        
           | 
           | 
          T  | 
          value  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Sets the value of a socket option. 
- Template Parameters
 - 
  
  
 
- Parameters
 - 
  
    | level | The level at which to change the socket options  | 
    | name | The option to change the value of  | 
    | value | The value to set  | 
  
   
- Returns
 - True if set successfully 
 
 
 
◆ fd