Add several constants needed to use multicast UDP
This was verified by @todbot to work on esp32 s2 and s3; the constant should match any system that uses LWIP numbering.
This commit is contained in:
parent
4593008317
commit
d23ddff971
|
@ -82,6 +82,10 @@ MP_DEFINE_EXCEPTION(gaierror, OSError)
|
|||
//| TCP_NODELAY: int
|
||||
//|
|
||||
//| IPPROTO_TCP: int
|
||||
//| IPPROTO_IP: int
|
||||
//|
|
||||
//| IP_MULTICAST_TTL: int
|
||||
//|
|
||||
//| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM) -> socketpool.Socket:
|
||||
//| """Create a new socket
|
||||
//|
|
||||
|
@ -182,6 +186,8 @@ STATIC const mp_rom_map_elem_t socketpool_socketpool_locals_dict_table[] = {
|
|||
{ MP_ROM_QSTR(MP_QSTR_TCP_NODELAY), MP_ROM_INT(SOCKETPOOL_TCP_NODELAY) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_IPPROTO_TCP), MP_ROM_INT(SOCKETPOOL_IPPROTO_TCP) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_IPPROTO_IP), MP_ROM_INT(SOCKETPOOL_IPPROTO_IP) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_IP_MULTICAST_TTL), MP_ROM_INT(SOCKETPOOL_IP_MULTICAST_TTL) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_EAI_NONAME), MP_ROM_INT(SOCKETPOOL_EAI_NONAME) },
|
||||
};
|
||||
|
|
|
@ -45,6 +45,7 @@ typedef enum {
|
|||
} socketpool_socketpool_addressfamily_t;
|
||||
|
||||
typedef enum {
|
||||
SOCKETPOOL_IPPROTO_IP = 0,
|
||||
SOCKETPOOL_IPPROTO_TCP = 6,
|
||||
} socketpool_socketpool_ipproto_t;
|
||||
|
||||
|
@ -52,6 +53,10 @@ typedef enum {
|
|||
SOCKETPOOL_TCP_NODELAY = 1,
|
||||
} socketpool_socketpool_tcpopt_t;
|
||||
|
||||
typedef enum {
|
||||
SOCKETPOOL_IP_MULTICAST_TTL = 5,
|
||||
} socketpool_socketpool_ipopt_t;
|
||||
|
||||
typedef enum {
|
||||
SOCKETPOOL_EAI_NONAME = -2,
|
||||
} socketpool_eai_t;
|
||||
|
|
Loading…
Reference in New Issue