diff options
author | Ian Moffett <ian@osmora.org> | 2025-08-04 20:13:59 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-08-04 20:13:59 -0400 |
commit | 24b4eaa97c0ba3c45406ac293a35d78c5342aac8 (patch) | |
tree | fef7e0c00a58a5536ecde5e6fc74910a0c78223f /sys/include | |
parent | ff68e8679d7d2487126ff355ed2b34a6f84058bb (diff) |
kernel: socket: Implement recv() timeout
This commit implements proper timeout handling for recv(). Previously,
the recv() syscall would yield the current process forver until data is
available to be read. Obviously, that is not the most ideal as it is not
uncommon for programs to try seeing if any data exists on the socket
before deferring to perform some other task until data arrives.
The basics of how this work is that we try reading data off of some
specified socket. However, if no data is present, we must wait for the
given timeout value before attempting to read again.
While this is pretty effective and works perfectly fine as of now, it
might be worth optimizing this later to allow that timeout period to be
somehow "interrupted" by data arriving at a socket so that the program
does not have to defer execution for the full wait-period.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
0 files changed, 0 insertions, 0 deletions