|
ESPHome 2026.11.0-dev
|
Connected socket implementation for LWIP raw TCP. More...
#include <lwip_raw_tcp_impl.h>
Public Member Functions | |
| ~LWIPRawImpl () | |
| void | init (struct pbuf *initial_rx=nullptr, bool initial_rx_closed=false) |
| std::unique_ptr< LWIPRawImpl > | accept (struct sockaddr *, socklen_t *) |
| std::unique_ptr< LWIPRawImpl > | accept_loop_monitored (struct sockaddr *addr, socklen_t *addrlen) |
| int | listen (int) |
| int | connect (const struct sockaddr *addr, socklen_t addrlen) |
| Non-blocking: returns -1/EINPROGRESS once the SYN is queued, see poll_connect(). | |
| ConnectPollResult | poll_connect (int &err_out) const |
| ssize_t | read (void *buf, size_t len) |
| ssize_t | readv (const struct iovec *iov, int iovcnt) |
| ssize_t | recvfrom (void *, size_t, sockaddr *, socklen_t *) |
| ssize_t | write (const void *buf, size_t len) |
| ssize_t | writev (const struct iovec *iov, int iovcnt) |
| ssize_t | sendto (const void *, size_t, int, const struct sockaddr *, socklen_t) |
| bool | ready () const |
| int | setblocking (bool blocking) |
| int | loop () |
| err_t | recv_fn (struct pbuf *pb, err_t err) |
| LWIPRawCommon (sa_family_t family, struct tcp_pcb *pcb) | |
| LWIPRawCommon (const LWIPRawCommon &)=delete | |
Public Member Functions inherited from esphome::socket::LWIPRawCommon | |
| LWIPRawCommon (sa_family_t family, struct tcp_pcb *pcb) | |
| ~LWIPRawCommon () | |
| LWIPRawCommon (const LWIPRawCommon &)=delete | |
| LWIPRawCommon & | operator= (const LWIPRawCommon &)=delete |
| int | bind (const struct sockaddr *name, socklen_t addrlen) |
| int | close () |
| int | shutdown (int how) |
| int | getpeername (struct sockaddr *name, socklen_t *addrlen) |
| int | getsockname (struct sockaddr *name, 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 | get_fd () const |
Static Public Member Functions | |
| static void | s_err_fn (void *arg, err_t err) |
| static err_t | s_recv_fn (void *arg, struct tcp_pcb *pcb, struct pbuf *pb, err_t err) |
| static err_t | s_connected_fn (void *arg, struct tcp_pcb *pcb, err_t err) |
Protected Member Functions | |
| bool | waiting_for_data_ () const |
| void | wait_for_data_ () |
| ssize_t | read_locked_ (void *buf, size_t len) |
| ssize_t | internal_write_ (const void *buf, size_t len) |
| int | internal_output_ () |
Protected Member Functions inherited from esphome::socket::LWIPRawCommon | |
| int | ip2sockaddr_ (ip_addr_t *ip, uint16_t port, struct sockaddr *name, socklen_t *addrlen) |
| bool | sockaddr2ip_ (const struct sockaddr *name, socklen_t addrlen, ip_addr_t *ip, uint16_t *port, bool for_bind) const |
| sockaddr of this socket's family to lwip address and port; false with errno on mismatch. | |
Protected Attributes | |
| pbuf * | rx_buf_ = nullptr |
| size_t | rx_buf_offset_ = 0 |
| bool | rx_closed_ = false |
Protected Attributes inherited from esphome::socket::LWIPRawCommon | |
| struct tcp_pcb * | pcb_ |
| bool | nodelay_ = false |
| sa_family_t | family_ = 0 |
| uint8_t | recv_timeout_cs_ = 0 |
| uint8_t | connect_err_ = 0 |
Connected socket implementation for LWIP raw TCP.
No virtual methods — callers always use the concrete type.
Definition at line 75 of file lwip_raw_tcp_impl.h.
| esphome::socket::LWIPRawImpl::~LWIPRawImpl | ( | ) |
Definition at line 313 of file lwip_raw_tcp_impl.cpp.
|
inline |
Definition at line 83 of file lwip_raw_tcp_impl.h.
|
inline |
Definition at line 87 of file lwip_raw_tcp_impl.h.
Non-blocking: returns -1/EINPROGRESS once the SYN is queued, see poll_connect().
addr must match the socket family; an IPv4 peer on AF_INET6 arrives v4-mapped.
Definition at line 365 of file lwip_raw_tcp_impl.cpp.
| void esphome::socket::LWIPRawImpl::init | ( | struct pbuf * | initial_rx = nullptr, |
| bool | initial_rx_closed = false ) |
Definition at line 325 of file lwip_raw_tcp_impl.cpp.
|
protected |
Definition at line 601 of file lwip_raw_tcp_impl.cpp.
|
protected |
Definition at line 568 of file lwip_raw_tcp_impl.cpp.
|
inline |
Definition at line 92 of file lwip_raw_tcp_impl.h.
|
inline |
Definition at line 133 of file lwip_raw_tcp_impl.h.
|
delete |
|
inline |
Definition at line 29 of file lwip_raw_tcp_impl.h.
| ConnectPollResult esphome::socket::LWIPRawImpl::poll_connect | ( | int & | err_out | ) | const |
Definition at line 393 of file lwip_raw_tcp_impl.cpp.
| ssize_t esphome::socket::LWIPRawImpl::read | ( | void * | buf, |
| size_t | len ) |
Definition at line 527 of file lwip_raw_tcp_impl.cpp.
|
protected |
Definition at line 467 of file lwip_raw_tcp_impl.cpp.
Definition at line 542 of file lwip_raw_tcp_impl.cpp.
|
inline |
Definition at line 120 of file lwip_raw_tcp_impl.h.
| err_t esphome::socket::LWIPRawImpl::recv_fn | ( | struct pbuf * | pb, |
| err_t | err ) |
Definition at line 421 of file lwip_raw_tcp_impl.cpp.
|
inline |
Definition at line 104 of file lwip_raw_tcp_impl.h.
|
static |
Definition at line 357 of file lwip_raw_tcp_impl.cpp.
|
static |
Definition at line 338 of file lwip_raw_tcp_impl.cpp.
|
static |
Definition at line 416 of file lwip_raw_tcp_impl.cpp.
|
inline |
Definition at line 110 of file lwip_raw_tcp_impl.h.
|
inline |
Definition at line 124 of file lwip_raw_tcp_impl.h.
|
protected |
Definition at line 450 of file lwip_raw_tcp_impl.cpp.
|
inlineprotected |
Definition at line 147 of file lwip_raw_tcp_impl.h.
| ssize_t esphome::socket::LWIPRawImpl::write | ( | const void * | buf, |
| size_t | len ) |
Definition at line 628 of file lwip_raw_tcp_impl.cpp.
Definition at line 645 of file lwip_raw_tcp_impl.cpp.
|
protected |
Definition at line 153 of file lwip_raw_tcp_impl.h.
|
protected |
Definition at line 154 of file lwip_raw_tcp_impl.h.
|
protected |
Definition at line 155 of file lwip_raw_tcp_impl.h.