X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fnetwork.h;h=f83c796a95a557d3687a2324e0b6841123b5f063;hb=4ec4454ccf72ceca06393b4b3759e3412cf885da;hp=86fb65616478ddafdb01de35348f48a5374d3a0f;hpb=8324d427c21aa37e173983cb1ba12915b4d62a8d;p=ffmpeg diff --git a/libavformat/network.h b/libavformat/network.h index 86fb6561647..f83c796a95a 100644 --- a/libavformat/network.h +++ b/libavformat/network.h @@ -254,6 +254,26 @@ int ff_listen_bind(int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout, 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. *