mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-04 21:09:19 +08:00
add read timeout when reading from UDP socket.
This commit is contained in:
parent
35804a3bb6
commit
9d8a94786c
@ -257,6 +257,9 @@ static int udp_read(ACL_SOCKET fd, void *buf, size_t size,
|
|||||||
|
|
||||||
if (stream->read_ready) {
|
if (stream->read_ready) {
|
||||||
stream->read_ready = 0;
|
stream->read_ready = 0;
|
||||||
|
} else if (stream->rw_timeout > 0
|
||||||
|
&& acl_read_wait(fd, stream->rw_timeout) < 0) {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (int) recvfrom(fd, buf, (int) size, 0,
|
ret = (int) recvfrom(fd, buf, (int) size, 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user