MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_network_wait_fd_timeout

Function ff_network_wait_fd_timeout

libavformat/network.c:75–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75int ff_network_wait_fd_timeout(int fd, int write, int64_t timeout, AVIOInterruptCB *int_cb)
76{
77 int ret;
78 int64_t wait_start = 0;
79
80 while (1) {
81 if (ff_check_interrupt(int_cb))
82 return AVERROR_EXIT;
83 ret = ff_network_wait_fd(fd, write);
84 if (ret != AVERROR(EAGAIN))
85 return ret;
86 if (timeout > 0) {
87 if (!wait_start)
88 wait_start = av_gettime_relative();
89 else if (av_gettime_relative() - wait_start > timeout)
90 return AVERROR(ETIMEDOUT);
91 }
92 }
93}
94
95int ff_network_sleep_interruptible(int64_t timeout, AVIOInterruptCB *int_cb)
96{

Callers 4

tcp_readFunction · 0.85
tcp_writeFunction · 0.85
amqp_proto_writeFunction · 0.85
amqp_proto_readFunction · 0.85

Calls 3

ff_check_interruptFunction · 0.85
ff_network_wait_fdFunction · 0.85
av_gettime_relativeFunction · 0.85

Tested by

no test coverage detected