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

Function tcp_read

libavformat/tcp.c:269–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269static int tcp_read(URLContext *h, uint8_t *buf, int size)
270{
271 TCPContext *s = h->priv_data;
272 int ret;
273
274 if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
275 ret = ff_network_wait_fd_timeout(s->fd, 0, h->rw_timeout, &h->interrupt_callback);
276 if (ret)
277 return ret;
278 }
279 ret = recv(s->fd, buf, size, 0);
280 if (ret == 0)
281 return AVERROR_EOF;
282 return ret < 0 ? ff_neterrno() : ret;
283}
284
285static int tcp_write(URLContext *h, const uint8_t *buf, int size)
286{

Callers

nothing calls this directly

Calls 2

ff_neterrnoFunction · 0.85

Tested by

no test coverage detected