xucvai · 2021年12月29日

全志XR806芯片 getsockopt、setsockopt失败如何解决?

请问全志XR806芯片 getsockopt、setsockopt失败如何解决?

1 个回答 得票排序 · 时间排序
极术小姐姐 · 2021年12月29日
本回答来源全志XR806芯片 getsockopt、setsockopt失败如何解决?

以 SDK 中 lwip-2.0.3 为例。可以通过打开文件 include/net/lwip-2.0.3/lwip/sockets.h 查看目前版本 LwIP 支持哪些 socket 属性的设置/获取。

#define SO_DEBUG       0x0001 /* Unimplemented: turn on debugging info recording */
#define SO_ACCEPTCONN  0x0002 /* socket has had listen() */
#define SO_DONTROUTE   0x0010 /* Unimplemented: just use interface addresses */
#define SO_USELOOPBACK 0x0040 /* Unimplemented: bypass hardware when possible */
#define SO_LINGER      0x0080 /* linger on close if data present */
#define SO_DONTLINGER  ((int)(~SO_LINGER))
#define SO_OOBINLINE   0x0100 /* Unimplemented: leave received OOB data in line */
#define SO_REUSEPORT   0x0200 /* Unimplemented: allow local address & port reuse */
#define SO_SNDBUF      0x1001 /* Unimplemented: send buffer size */
#define SO_RCVBUF      0x1002 /* receive buffer size */
#define SO_SNDLOWAT    0x1003 /* Unimplemented: send low-water mark */
#define SO_RCVLOWAT    0x1004 /* Unimplemented: receive low-water mark */
#define SO_SNDTIMEO    0x1005 /* send timeout */
#define SO_RCVTIMEO    0x1006 /* receive timeout */
#define SO_ERROR       0x1007 /* get error status and clear */
#define SO_TYPE        0x1008 /* get socket type */
#define SO_CONTIMEO    0x1009 /* Unimplemented: connect timeout */
#define SO_NO_CHECK    0x100a /* don't create UDP checksum */

如上所示,若该属性后的注释有 Unimplemented 标识,则未支持。

你的回答