GNOME Bugzilla – Bug 754534
rtspsrc: Fails on Windows with 'An existing connection was forcibly closed by the remote host' b/c of NAT hole punching
Last modified: 2015-09-21 14:22:16 UTC
Created attachment 310607 [details] output of >gst-launch-1.0 -v -m -t rtspsrc location="rtsp://10.1.12.210/rtsp_tunnel?h26x=4&line=1&inst=1" ! rtph264depay ! decodebin ! autovideosink --gst-debug=2,*udp*:6,*rtp*:6,*rtsp*:6 gstreamer version 1.5.90 x86 Windows 7 professional Service pack 1 Posted question to gstreamer-devel@lists.freedesktop.org and was directed to post a bug. Please refer to attachment for gst-launch-1.0 " > This is the error here, receiving packets from the UDP socket failed > for whatever reason. The error message is not very helpful as UDP is > connection-less :) If I understand this correctly from the PCAP log, > the problem is that we're sending data via UDP to the server in the > beginning on the ports that would be used for receiving data from the > server... the server replies via ICMP that those ports are > unreachable, and then the socket fails with the above error on the > receiver side. Not sure what exactly we're sending to the server > there, it's not proper RTP and I don't think we should send anything > there at all at this point. What is sent there are 5 200 byte packets with random data to open up NATs, so that we can actually receive back UDP packets for NATs that have UDP "connection" tracking. Unfortunately the server is not listening on that port, and we're using the same socket for receiving UDP packets and sending these dummy packets... so on the next time a packet is received, the socket reports an error. Please report this in Bugzilla? Thanks! "
Created attachment 310608 [details] Wireshark Capture for gst-launch-1.0 log file
Not sure what we should do about this here, we could just use different sockets and bind them both to the same ports maybe. Not sure if that also works for the NAT traversal. Related to this is also bug #750728, which seems to indicate that GSocket is not threadsafe enough on Windows for sending from one thread and receiving from another simultaneously.
Created attachment 310649 [details] [review] udpsrc: Ignore G_IO_ERROR_CONNECTION_CLOSED when receiving data This happens on Windows if we use the same socket for sending packets, and the remote sends ICMP port/host unreachable messages.
Can you check if this works for you?
I have only been working with gstreamer-1.0-x86-1.5.90.msi & gstreamer-1.0-devel-x86-1.5.90.msi binaries, and do not have the source code or projects to recompile to test these changes. If you could provide newly compiled DLL(s) I will definitely add it to my test bed and give you results.
Ok, please test 1.5.91 once it is released then :)
You can get the 1.5.91 binaries from here: http://lists.freedesktop.org/archives/gstreamer-devel/2015-September/054631.html Let me know if that helps
Yes 1.5.91 appears to have corrected issue. Thank you for your help.