2019-06-20 06:22:53 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "socket.hh"
|
|
|
|
|
2020-04-27 11:07:24 +00:00
|
|
|
namespace uvg_rtp {
|
2019-06-20 06:22:53 +00:00
|
|
|
namespace poll {
|
|
|
|
/* Cross-platform poll implementation for listening to a socket for a period of time
|
|
|
|
*
|
|
|
|
* This is used by RTCP to listen to socket RTCP_MIN_TIMEOUT (5s for now).
|
|
|
|
*
|
2019-08-16 08:01:31 +00:00
|
|
|
* "timeout" is in milliseconds
|
|
|
|
*
|
2019-06-20 06:22:53 +00:00
|
|
|
* If some actions happens with the socket, return status
|
|
|
|
* If the timeout is exceeded, return RTP_INTERRUPTED */
|
2020-04-27 11:07:24 +00:00
|
|
|
rtp_error_t poll(std::vector<uvg_rtp::socket>& sockets, uint8_t *buf, size_t buf_len, int timeout, int *bytes_read);
|
2020-10-01 06:41:36 +00:00
|
|
|
|
|
|
|
/* TODO: */
|
|
|
|
rtp_error_t blocked_recv(uvg_rtp::socket *socket, uint8_t *buf, size_t buf_len, int timeout, int *bytes_read);
|
2019-06-20 06:22:53 +00:00
|
|
|
};
|
|
|
|
};
|