tcp: add TCP_ACKDATA flag to close event callback

The close package cannot be sent in time without TCP_ACKDATA

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2022-05-05 15:59:10 +08:00 committed by Petro Karashchenko
parent 3725fe28fb
commit c1521b2ef2

View file

@ -285,7 +285,8 @@ static inline int tcp_close_disconnect(FAR struct socket *psock)
{
/* Set up to receive TCP data event callbacks */
conn->clscb->flags = TCP_NEWDATA | TCP_POLL | TCP_DISCONN_EVENTS;
conn->clscb->flags = TCP_NEWDATA | TCP_ACKDATA |
TCP_POLL | TCP_DISCONN_EVENTS;
conn->clscb->event = tcp_close_eventhandler;
conn->clscb->priv = conn; /* reference for event handler to free cb */