Skip to content

Commit a8c9b2f

Browse files
committed
[net][at] Modify 'AT+CLOSE' processing method
1 parent 87c35d4 commit a8c9b2f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/net/at/at_socket/at_socket.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ int at_closesocket(int socket)
385385
return -1;
386386
}
387387

388+
/* deal with TCP server actively disconnect */
389+
rt_thread_delay(rt_tick_from_millisecond(100));
390+
388391
sock = at_get_socket(socket);
389392
if (sock == RT_NULL)
390393
{
@@ -401,6 +404,7 @@ int at_closesocket(int socket)
401404
if (at_dev_ops->at_closesocket(socket) != 0)
402405
{
403406
LOG_E("AT socket (%d) closesocket failed!", socket);
407+
return -1;
404408
}
405409
}
406410

@@ -427,6 +431,7 @@ int at_shutdown(int socket, int how)
427431
if (at_dev_ops->at_closesocket(socket) != 0)
428432
{
429433
LOG_E("AT socket (%d) shutdown failed!", socket);
434+
return -1;
430435
}
431436
}
432437

0 commit comments

Comments
 (0)