New submission from yeyingxian <[email protected]>:

On Windows, not the read or write lists but rather the 
exception list is used for detecting failed connects

http://itamarst.org/writings/win32sockets.html

So if tcp connection fails on Windows, ffmpeg may dead 
loop in tcp_open(). I suggest modify tcp_open() to

        /* wait until we are connected or until abort 
*/
        for(;;) {
            if (url_interrupt_cb()) {
                ret = AVERROR(EINTR);
                goto fail1;
            }
            fd_max = fd;
            FD_ZERO(&wfds);
            FD_ZERO(&efds);
            FD_SET(fd, &wfds);
            FD_SET(fd, &efds);
            tv.tv_sec = 0;
            tv.tv_usec = 100 * 1000;
            ret = select(fd_max + 1, NULL, &wfds, 
&efds, &tv);
            if (ret > 0 && (FD_ISSET(fd, &wfds) || 
FD_ISSET(fd, &efds))
                break;
        }

----------
messages: 11961
priority: normal
status: new
substatus: new
title: ffmpeg cannot detect tcp connection failture on Windows
type: bug

________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/issue2237>
________________________________________________

Reply via email to