Open StevenJiang1110 opened 1 month ago
The original solution is to change the code
like follows
if old_instant == 0 || new_instant < old_instant {
It works 40 days ago (2024.5.8). But it will break the send_buf_full test in the main branch now(2024.6.18).
The problem occurs when I trying to send two messages to the same TCP socket, and trying to receive the two messages at once.
The test program always succeeds when running on Linux.
However, when running on Asterinas,
sk_connected
can only accept the first message.The problem disappears when I running in set log level as TRACE. So it may be some problems with timeout.......
Possible solution
This problem may be related to the nagle-enabled feature, which disables small packets to be transmitted. If set
nagle-enabled
as false, the problem will also disappear.But totally disabling this feature may affect performance. This feature is same as the
TCP_NODELAY
option in Linux, but Linux keeps this option on by default.