ESPHome 2026.3.0-dev
Loading...
Searching...
No Matches
esphome::socket::LwIPSocketImpl Class Reference

#include <lwip_sockets_impl.h>

Public Member Functions

 LwIPSocketImpl (int fd, bool monitor_loop=false)
 
 ~LwIPSocketImpl ()
 
 LwIPSocketImpl (const LwIPSocketImpl &)=delete
 
LwIPSocketImploperator= (const LwIPSocketImpl &)=delete
 
int connect (const struct sockaddr *addr, socklen_t addrlen)
 
std::unique_ptr< LwIPSocketImplaccept (struct sockaddr *addr, socklen_t *addrlen)
 
std::unique_ptr< LwIPSocketImplaccept_loop_monitored (struct sockaddr *addr, socklen_t *addrlen)
 
int bind (const struct sockaddr *addr, socklen_t addrlen)
 
int close ()
 
int shutdown (int how)
 
int getpeername (struct sockaddr *addr, socklen_t *addrlen)
 
int getsockname (struct sockaddr *addr, socklen_t *addrlen)
 
size_t getpeername_to (std::span< char, SOCKADDR_STR_LEN > buf)
 Format peer address into a fixed-size buffer (no heap allocation)
 
size_t getsockname_to (std::span< char, SOCKADDR_STR_LEN > buf)
 Format local address into a fixed-size buffer (no heap allocation)
 
int getsockopt (int level, int optname, void *optval, socklen_t *optlen)
 
int setsockopt (int level, int optname, const void *optval, socklen_t optlen)
 
int listen (int backlog)
 
ssize_t read (void *buf, size_t len)
 
ssize_t recvfrom (void *buf, size_t len, sockaddr *addr, socklen_t *addr_len)
 
ssize_t readv (const struct iovec *iov, int iovcnt)
 
ssize_t write (const void *buf, size_t len)
 
ssize_t send (const void *buf, size_t len, int flags)
 
ssize_t writev (const struct iovec *iov, int iovcnt)
 
ssize_t sendto (const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen)
 
int setblocking (bool blocking)
 
int loop ()
 
bool ready () const
 
int get_fd () const
 

Protected Attributes

int fd_ {-1}
 
bool closed_ {false}
 
bool loop_monitored_ {false}
 

Detailed Description

Definition at line 14 of file lwip_sockets_impl.h.

Constructor & Destructor Documentation

◆ LwIPSocketImpl() [1/2]

esphome::socket::LwIPSocketImpl::LwIPSocketImpl ( int fd,
bool monitor_loop = false )

Definition at line 12 of file lwip_sockets_impl.cpp.

◆ ~LwIPSocketImpl()

esphome::socket::LwIPSocketImpl::~LwIPSocketImpl ( )

Definition at line 21 of file lwip_sockets_impl.cpp.

◆ LwIPSocketImpl() [2/2]

esphome::socket::LwIPSocketImpl::LwIPSocketImpl ( const LwIPSocketImpl & )
delete

Member Function Documentation

◆ accept()

std::unique_ptr< LwIPSocketImpl > esphome::socket::LwIPSocketImpl::accept ( struct sockaddr * addr,
socklen_t * addrlen )
inline

Definition at line 22 of file lwip_sockets_impl.h.

◆ accept_loop_monitored()

std::unique_ptr< LwIPSocketImpl > esphome::socket::LwIPSocketImpl::accept_loop_monitored ( struct sockaddr * addr,
socklen_t * addrlen )
inline

Definition at line 28 of file lwip_sockets_impl.h.

◆ bind()

int esphome::socket::LwIPSocketImpl::bind ( const struct sockaddr * addr,
socklen_t addrlen )
inline

Definition at line 35 of file lwip_sockets_impl.h.

◆ close()

int esphome::socket::LwIPSocketImpl::close ( )

Definition at line 27 of file lwip_sockets_impl.cpp.

◆ connect()

int esphome::socket::LwIPSocketImpl::connect ( const struct sockaddr * addr,
socklen_t addrlen )
inline

Definition at line 21 of file lwip_sockets_impl.h.

◆ get_fd()

int esphome::socket::LwIPSocketImpl::get_fd ( ) const
inline

Definition at line 70 of file lwip_sockets_impl.h.

◆ getpeername()

int esphome::socket::LwIPSocketImpl::getpeername ( struct sockaddr * addr,
socklen_t * addrlen )
inline

Definition at line 39 of file lwip_sockets_impl.h.

◆ getpeername_to()

size_t esphome::socket::LwIPSocketImpl::getpeername_to ( std::span< char, SOCKADDR_STR_LEN > buf)

Format peer address into a fixed-size buffer (no heap allocation)

Definition at line 53 of file lwip_sockets_impl.cpp.

◆ getsockname()

int esphome::socket::LwIPSocketImpl::getsockname ( struct sockaddr * addr,
socklen_t * addrlen )
inline

Definition at line 40 of file lwip_sockets_impl.h.

◆ getsockname_to()

size_t esphome::socket::LwIPSocketImpl::getsockname_to ( std::span< char, SOCKADDR_STR_LEN > buf)

Format local address into a fixed-size buffer (no heap allocation)

Definition at line 63 of file lwip_sockets_impl.cpp.

◆ getsockopt()

int esphome::socket::LwIPSocketImpl::getsockopt ( int level,
int optname,
void * optval,
socklen_t * optlen )
inline

Definition at line 47 of file lwip_sockets_impl.h.

◆ listen()

int esphome::socket::LwIPSocketImpl::listen ( int backlog)
inline

Definition at line 53 of file lwip_sockets_impl.h.

◆ loop()

int esphome::socket::LwIPSocketImpl::loop ( )
inline

Definition at line 66 of file lwip_sockets_impl.h.

◆ operator=()

LwIPSocketImpl & esphome::socket::LwIPSocketImpl::operator= ( const LwIPSocketImpl & )
delete

◆ read()

ssize_t esphome::socket::LwIPSocketImpl::read ( void * buf,
size_t len )
inline

Definition at line 54 of file lwip_sockets_impl.h.

◆ readv()

ssize_t esphome::socket::LwIPSocketImpl::readv ( const struct iovec * iov,
int iovcnt )
inline

Definition at line 58 of file lwip_sockets_impl.h.

◆ ready()

bool esphome::socket::LwIPSocketImpl::ready ( ) const

Definition at line 51 of file lwip_sockets_impl.cpp.

◆ recvfrom()

ssize_t esphome::socket::LwIPSocketImpl::recvfrom ( void * buf,
size_t len,
sockaddr * addr,
socklen_t * addr_len )
inline

Definition at line 55 of file lwip_sockets_impl.h.

◆ send()

ssize_t esphome::socket::LwIPSocketImpl::send ( const void * buf,
size_t len,
int flags )
inline

Definition at line 60 of file lwip_sockets_impl.h.

◆ sendto()

ssize_t esphome::socket::LwIPSocketImpl::sendto ( const void * buf,
size_t len,
int flags,
const struct sockaddr * to,
socklen_t tolen )
inline

Definition at line 62 of file lwip_sockets_impl.h.

◆ setblocking()

int esphome::socket::LwIPSocketImpl::setblocking ( bool blocking)

Definition at line 40 of file lwip_sockets_impl.cpp.

◆ setsockopt()

int esphome::socket::LwIPSocketImpl::setsockopt ( int level,
int optname,
const void * optval,
socklen_t optlen )
inline

Definition at line 50 of file lwip_sockets_impl.h.

◆ shutdown()

int esphome::socket::LwIPSocketImpl::shutdown ( int how)
inline

Definition at line 37 of file lwip_sockets_impl.h.

◆ write()

ssize_t esphome::socket::LwIPSocketImpl::write ( const void * buf,
size_t len )
inline

Definition at line 59 of file lwip_sockets_impl.h.

◆ writev()

ssize_t esphome::socket::LwIPSocketImpl::writev ( const struct iovec * iov,
int iovcnt )
inline

Definition at line 61 of file lwip_sockets_impl.h.

Field Documentation

◆ closed_

bool esphome::socket::LwIPSocketImpl::closed_ {false}
protected

Definition at line 74 of file lwip_sockets_impl.h.

◆ fd_

int esphome::socket::LwIPSocketImpl::fd_ {-1}
protected

Definition at line 73 of file lwip_sockets_impl.h.

◆ loop_monitored_

bool esphome::socket::LwIPSocketImpl::loop_monitored_ {false}
protected

Definition at line 75 of file lwip_sockets_impl.h.


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