implement ff_socket_nonblock and use it in networking code

Originally committed as revision 8846 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Alex Beregszaszi
2007-04-27 00:41:50 +00:00
parent 8da4034f52
commit ba472aaf01
4 changed files with 13 additions and 4 deletions

View File

@ -22,7 +22,6 @@
#include <unistd.h>
#include "network.h"
#include <sys/time.h>
#include <fcntl.h>
typedef struct TCPContext {
int fd;
@ -62,7 +61,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
fd = socket(AF_INET, SOCK_STREAM, 0);
if (fd < 0)
goto fail;
fcntl(fd, F_SETFL, O_NONBLOCK);
ff_socket_nonblock(fd, 1);
redo:
ret = connect(fd, (struct sockaddr *)&dest_addr,