Mercurial > libavformat.hg
diff tcp.c @ 2057:857fbfeb2fa0 libavformat
implement ff_socket_nonblock and use it in networking code
author | alex |
---|---|
date | Fri, 27 Apr 2007 00:41:50 +0000 |
parents | eeea52739ff3 |
children | b21c2af60bc9 |
line wrap: on
line diff
--- a/tcp.c Fri Apr 27 00:35:54 2007 +0000 +++ b/tcp.c Fri Apr 27 00:41:50 2007 +0000 @@ -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 @@ 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,