ESPHome  2022.9.1
Data Structures | Functions
esphome::socket Namespace Reference

Data Structures

class  Socket
 

Functions

std::string format_sockaddr (const struct sockaddr_storage &storage)
 
std::unique_ptr< Socketsocket (int domain, int type, int protocol)
 Create a socket of the given domain, type and protocol. More...
 
std::unique_ptr< Socketsocket_ip (int type, int protocol)
 Create a socket in the newest available IP domain (IPv6 or IPv4) of the given type and protocol. More...
 
socklen_t set_sockaddr_any (struct sockaddr *addr, socklen_t addrlen, uint16_t port)
 Set a sockaddr to the any address for the IP version used by socket_ip(). More...
 

Function Documentation

◆ format_sockaddr()

std::string esphome::socket::format_sockaddr ( const struct sockaddr_storage storage)

Definition at line 17 of file bsd_sockets_impl.cpp.

◆ set_sockaddr_any()

socklen_t esphome::socket::set_sockaddr_any ( struct sockaddr addr,
socklen_t  addrlen,
uint16_t  port 
)

Set a sockaddr to the any address for the IP version used by socket_ip().

Definition at line 17 of file socket.cpp.

◆ socket()

std::unique_ptr< Socket > esphome::socket::socket ( int  domain,
int  type,
int  protocol 
)

Create a socket of the given domain, type and protocol.

Definition at line 153 of file bsd_sockets_impl.cpp.

◆ socket_ip()

std::unique_ptr< Socket > esphome::socket::socket_ip ( int  type,
int  protocol 
)

Create a socket in the newest available IP domain (IPv6 or IPv4) of the given type and protocol.

Definition at line 9 of file socket.cpp.