diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-06-05 11:56:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-06-05 11:56:56 +0200 |
commit | 82070b01b85f200ec1a76064159f82626c167c12 (patch) | |
tree | 0c7b43a067e268ebfd3207281b0ecc47816888d8 /libavformat/network.h | |
parent | 606e8baf0fec23140f2a1baffb8752cb761039f5 (diff) | |
parent | 9835abb6d63fb07613994ae90e72fef758149408 (diff) | |
download | ffmpeg-82070b01b85f200ec1a76064159f82626c167c12.tar.gz |
Merge commit '9835abb6d63fb07613994ae90e72fef758149408'
* commit '9835abb6d63fb07613994ae90e72fef758149408':
network: uniform ff_listen_bind and ff_listen_connect
Conflicts:
libavformat/network.c
libavformat/tcp.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/network.h')
-rw-r--r-- | libavformat/network.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/libavformat/network.h b/libavformat/network.h index c6264fdc5f..3798f97829 100644 --- a/libavformat/network.h +++ b/libavformat/network.h @@ -223,9 +223,38 @@ const char *ff_gai_strerror(int ecode); int ff_is_multicast_address(struct sockaddr *addr); +#define POLLING_TIME 100 /// Time in milliseconds between interrupt check + +/** + * Bind to a file descriptor and poll for a connection. + * + * @param fd First argument of bind(). + * @param addr Second argument of bind(). + * @param addrlen Third argument of bind(). + * @param timeout Polling timeout in milliseconds. + * @param h URLContext providing interrupt check + * callback and logging context. + * @return A non-blocking file descriptor on success + * or an AVERROR on failure. + */ int ff_listen_bind(int fd, const struct sockaddr *addr, - socklen_t addrlen, int timeout); + socklen_t addrlen, int timeout, + URLContext *h); + +/** + * Connect to a file descriptor and poll for result. + * + * @param fd First argument of connect(), + * will be set as non-blocking. + * @param addr Second argument of connect(). + * @param addrlen Third argument of connect(). + * @param timeout Polling timeout in milliseconds. + * @param h URLContext providing interrupt check + * callback and logging context. + * @return 0 on success, AVERROR on failure. + */ int ff_listen_connect(int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout, URLContext *h); + #endif /* AVFORMAT_NETWORK_H */ |