anchao commented on code in PR #8129:
URL: https://github.com/apache/nuttx/pull/8129#discussion_r1071796741
##########
net/socket/Kconfig:
##########
@@ -43,7 +43,6 @@ config NET_SOLINGER
bool "SO_LINGER socket option"
default n
depends on NET_TCP_WRITE_BUFFERS || NET_UDP_WRITE_BUFFERS
- select NET_TCP_NOTIFIER if NET_TCP
select NET_UDP_NOTIFIER if NET_UDP
Review Comment:
@acassis
In this PR I also solved the indefinitely block issue in udp_close, please
review this change
https://github.com/apache/nuttx/pull/8129/commits/cb2671f34ee70013b13ecdafb382ebcadb96d551
net/udp: correct linger timeout
UDP linger timeout will be wrongly converted to UINT_MAX by _SO_TIMEOUT()
when it is set to 0,
net/socket/socket.h:
```
|
| # define _SO_TIMEOUT(t) ((t) ? (t) * MSEC_PER_DSEC : UINT_MAX)
```
net/udp/udp_close.c:
```
|
| if (_SO_GETOPT(conn->sconn.s_options, SO_LINGER))
| {
| timeout = _SO_TIMEOUT(conn->sconn.s_linger);
| }
```
this change will correct this behavior, if the linger is set to 0, the
timeout value should be 0
Signed-off-by: chao an <[email protected]>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]