diff options
author | Stephan Holljes <klaxa1337@googlemail.com> | 2015-07-03 03:22:25 +0300 |
---|---|---|
committer | Stephan Holljes <klaxa1337@googlemail.com> | 2015-08-01 01:58:31 +0300 |
commit | cf6c871beec9039dc6d7ebda57358161d64062c3 (patch) | |
tree | 5087a55abc6b9c67d9481e3969b1439793d9d6f8 /libavformat/network.h | |
parent | 5870b3d2a3afdae0ed42fa9fd010684ee18feca8 (diff) |
lavf/network: split ff_listen_bind into ff_listen and ff_accept
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
Diffstat (limited to 'libavformat/network.h')
-rw-r--r-- | libavformat/network.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libavformat/network.h b/libavformat/network.h index 86fb656164..f83c796a95 100644 --- a/libavformat/network.h +++ b/libavformat/network.h @@ -255,6 +255,26 @@ int ff_listen_bind(int fd, const struct sockaddr *addr, URLContext *h); /** + * Bind to a file descriptor to an address without accepting connections. + * @param fd First argument of bind(). + * @param addr Second argument of bind(). + * @param addrlen Third argument of bind(). + * @return 0 on success or an AVERROR on failure. + */ +int ff_listen(int fd, const struct sockaddr *addr, socklen_t addrlen); + +/** + * Poll for a single connection on the passed file descriptor. + * @param fd The listening socket file descriptor. + * @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_accept(int fd, int timeout, URLContext *h); + +/** * Connect to a file descriptor and poll for result. * * @param fd First argument of connect(), |