Chapter 4. API Guides
Error code
ECONNREFUSED
EADDRINUSE
ECONNABORTED
ENETUNREACH
ENETDOWN
ETIMEDOUT
EHOSTDOWN
EHOSTUNREACH
EINPROGRESS
EALREADY
EDESTADDRREQ
EPROTONOSUPPORT
Socket Options
The getsockopt() and setsockopt() functions allow getting/setting per-socket options.
Not all standard socket options are supported by lwIP in ESP-IDF. The following socket options are supported:
Common options
Used with level argument SOL_SOCKET.
• SO_REUSEADDR (available if
FIG_LWIP_SO_REUSE_RXTOALL)
• SO_KEEPALIVE
• SO_BROADCAST
• SO_ACCEPTCONN
• SO_RCVBUF (available if
• SO_SNDTIMEO / SO_RCVTIMEO
• SO_ERROR (this option is only used with select(), see
• SO_TYPE
• SO_NO_CHECK (for UDP sockets only)
IP options
Used with level argument IPPROTO_IP.
• IP_TOS
• IP_TTL
• IP_PKTINFO (available if
For multicast UDP sockets:
• IP_MULTICAST_IF
• IP_MULTICAST_LOOP
• IP_MULTICAST_TTL
• IP_ADD_MEMBERSHIP
• IP_DROP_MEMBERSHIP
TCP options
TCP sockets only. Used with level argument IPPROTO_TCP.
• TCP_NODELAY
Options relating to TCP keepalive probes:
• TCP_KEEPALIVE (int value, TCP keepalive period in milliseconds)
• TCP_KEEPIDLE (same as TCP_KEEPALIVE, but the value is in seconds)
• TCP_KEEPINTVL (int value, interval between keepalive probes in seconds)
• TCP_KEEPCNT (int value, number of keepalive probes before timing out)
Espressif Systems
Description
Connection refused
Address already in use
Software caused connection abort
Network is unreachable
Network interface is not configured
Connection timed out
Host is down
Host is unreachable
Connection already in progress
Socket already connected
Destination address required
Unknown protocol
CONFIG_LWIP_SO_REUSE
CONFIG_LWIP_SO_RCVBUF
CONFIG_LWIP_NETBUF_RECVINFO
1427
Submit Document Feedback
is set, behavior can be customized by setting
is set)
Socket Error
Handling)
is set)
CON-
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?