1、(st->sockets[socket]->magic == SAL_SOCKET_MAGIC) assertion failed t function:sal_get_socket, line number:319
在使用rtthread的AT组件使用esp32时,出现这个问题,可能原因是关闭套接字的指令两次。或者wifi断开后调用套接字关闭造成的
/**
* This function will get sal socket object by sal socket descriptor.
*
* @param socket sal socket index
*
* @return sal socket object of the current sal socket index
*/
struct sal_socket *sal_get_socket(int socket)
{
struct sal_socket_table *st = &socket_table;
if (socket < 0 || socket >= (int) st->max_socket)
{
return RT_NULL;
}
socket = socket - SAL_SOCKET_OFFSET;
/* check socket structure valid or not */
RT_ASSERT(st->sockets[socket]->magic == SAL_SOCKET_MAGIC);
return st->sockets[socket];
}