Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > rtmpdump
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 03-04-2014, 05:34 PM
gorilla.maguila gorilla.maguila is offline
Member
 
Join Date: Dec 2012
Posts: 62
gorilla.maguila is on a distinguished road
Default

Problem with GetSockError


Every time I try to dump:

Code:
rtmpdump -r rtmp://31.220.0.138:1935/redirect/actionx -W http://p.jwpcdn.com/6/8/jwplayer.flash.swf -p http://www.eucast.tv/embed.php?le=actionx --live --debug
I get a GetSockError:

Code:
DEBUG: Protocol : RTMP
DEBUG: Hostname : 31.220.0.138
DEBUG: Port     : 1935
DEBUG: Playpath : actionx
DEBUG: tcUrl    : rtmp://31.220.0.138:1935/redirect
DEBUG: swfUrl   : http://p.jwpcdn.com/6/8/jwplayer.flash.swf
DEBUG: pageUrl  : http://www.eucast.tv/embed.php?le=actionx
DEBUG: app      : redirect
DEBUG: live     : yes
DEBUG: timeout  : 30 sec
DEBUG: SWFSHA256:
DEBUG: ab 9a e6 97 d7 bd 16 16 cc 22 fc 6e e4 d6 67 fa
DEBUG: cc 32 0e bc 46 42 dc ea 22 4a f4 83 db 93 47 d2
DEBUG: SWFSize  : 320072
DEBUG: Setting buffer time to: 36000000ms
Connecting ...
DEBUG: RTMP_Connect1, ... connected, handshaking
DEBUG: HandShake: Client type: 03
DEBUG: HandShake: Client digest offset: 417
DEBUG: HandShake: Initial client digest: 
DEBUG: 65 08 c8 ae 10 5f a1 d0 0a 0c 71 47 38 f5 3c 6a
DEBUG: 41 d6 d7 9a ca e2 c0 86 69 55 fd a8 7b d5 45 05
DEBUG: RTMPSockBuf_Fill, recv returned -1. GetSockError(): 104 (Connection reset by peer)
ERROR: RTMP_Connect1, handshake failed.
DEBUG: Closing connection.
But right after this fails I try again to dump with the same parameters:

Code:
rtmpdump -r rtmp://31.220.0.138:1935/redirect/actionx -W http://p.jwpcdn.com/6/8/jwplayer.flash.swf -p http://www.eucast.tv/embed.php?le=actionx --live --debug
And magically works...

Code:
DEBUG: Protocol : RTMP
DEBUG: Hostname : 31.220.0.138
DEBUG: Port     : 1935
DEBUG: Playpath : actionx
DEBUG: tcUrl    : rtmp://31.220.0.138:1935/redirect
DEBUG: swfUrl   : http://p.jwpcdn.com/6/8/jwplayer.flash.swf
DEBUG: pageUrl  : http://www.eucast.tv/embed.php?le=actionx
DEBUG: app      : redirect
DEBUG: live     : yes
DEBUG: timeout  : 30 sec
DEBUG: SWFSHA256:
DEBUG: ab 9a e6 97 d7 bd 16 16 cc 22 fc 6e e4 d6 67 fa
DEBUG: cc 32 0e bc 46 42 dc ea 22 4a f4 83 db 93 47 d2
DEBUG: SWFSize  : 320072
DEBUG: Setting buffer time to: 36000000ms
Connecting ...
DEBUG: RTMP_Connect1, ... connected, handshaking
DEBUG: HandShake: Client type: 03
DEBUG: HandShake: Client digest offset: 417
DEBUG: HandShake: Initial client digest: 
DEBUG: 4b a9 eb 0e 7a b3 15 57 ae 92 cd da 35 4e 4d c2
DEBUG: 12 ce ed e5 fa d8 f4 d8 39 1d 54 d0 6c a0 de bc
DEBUG: HandShake: Type Answer   : 03
DEBUG: HandShake: Server Uptime : 96850052
DEBUG: HandShake: FMS Version   : 3.0.1.1

So first attempt fails and second attempt works, and this happens everytime. I've tried changing my IP, trying under other machines to check if I'm somehow geoblocked with the same two attempts result.

Can anybody enlighten me?
Reply With Quote
  #2  
Old 03-06-2014, 04:49 AM
gorilla.maguila gorilla.maguila is offline
Member
 
Join Date: Dec 2012
Posts: 62
gorilla.maguila is on a distinguished road
Default

Re: Problem with GetSockError


Here is a tcpdump capture of an unsuccessful session:

http://www.cloudshark.org/captures/b0c01d8de085

It seems that on RTMP_Connect0 the socket gets an ACK timeout and tries to retransmit two more times.

Then on RTMP_Connect1 receives a response of the two retransmitted packets in the form of a reset packet, hence fails.

Maybe forcing a SO_KEEPALIVE flag on RTMP_Connect0 to avoid retransmission solves it.
Reply With Quote
  #3  
Old 03-06-2014, 08:40 AM
gorilla.maguila gorilla.maguila is offline
Member
 
Join Date: Dec 2012
Posts: 62
gorilla.maguila is on a distinguished road
Default

Re: Problem with GetSockError


Solved with a small workaround in rtmpdump.c:


Code:
+ #define RTMP_CONNECT_RETRIES 5

- if (!RTMP_Connect(&rtmp, NULL))
- {
-      nStatus = RD_NO_CONNECT;
-      break;
- }

+ int i = 0;
+ result = 0;

+ for(i = 0; i < RTMP_CONNECT_RETRIES; i++){
+	if((result = RTMP_Connect(&rtmp, NULL)) == 1)
+		  break;
+ }
	  
+ if(!result)
+    break;
Reply With Quote
  #4  
Old 03-06-2014, 09:30 AM
KSV KSV is offline
Senior Member
 
Join Date: Apr 2011
Posts: 853
KSV is on a distinguished road
Cool

Re: Problem with GetSockError


why do you think it was an issue with rtmpdump? it could be an issue with server configuration which is rejecting first connection attempt.
Reply With Quote
  #5  
Old 03-06-2014, 09:37 AM
gorilla.maguila gorilla.maguila is offline
Member
 
Join Date: Dec 2012
Posts: 62
gorilla.maguila is on a distinguished road
Default

Re: Problem with GetSockError


Quote:
Originally Posted by KSV View Post
why do you think it was an issue with rtmpdump? it could be an issue with server configuration which is rejecting first connection attempt.
It is only a workaround not be mainlained upstream.

The problem seems to be somewhere else because dumping the swf client session it is not triggering any reconnect, the swf client manages to connect at first attempt.
Reply With Quote
Reply Post New Thread
Tags:



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 12:17 AM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons