Results 1 to 3 of 3

Thread: How to abort reconnection loop after certain number of failed attempts?

  1. #1
    Join Date
    Mar 2013
    Posts
    11

    Question How to abort reconnection loop after certain number of failed attempts?

    Hi,

    When I start a media caster stream it might happen that the provider of the rtsp stream is down. Wowza keeps trying to reconnect to that stream. I want to set Wowza to abort reconnection attempts on first connection failure. Best approach would be if I could set the number of connection attempts and also the time to wait between reconnection attempts.

    I tried to achieve this but I did not succedded entirely. I have a HTTPProvider where I define an IApplicationInstance and I do this:

    applicationInstance.startMediaCasterStream(someStreamName, "rtp");
    I also define a media caster listener for that app instance (implementing IMediaCasterNotify2).
    In that media caster listener I run this code inside onConnectFailure:

    public void onConnectFailure(IMediaCaster mediaCaster) {
    	...
    	IApplicationInstance applicationInstance = mediaCaster.getAppInstance();
    		
    	applicationInstance.stopMediaCasterStream(this.streamFileName);
    	applicationInstance.shutdown(false, true);
    	mediaCaster.shutdown(false);
    What I achieve with this is that the media caster stream stops after the first conection failure. But the application instance "hangs". I see this in Wowza log:

    INFO server comment - RTPMediaCaster.Reconnector[10131947:capture/7097d38d-9bab-46bc-86ab-477f0020cfd0:7097d38d-9bab-46bc-86ab-477f0020cfd0.stream]: done: 1
    and the stream manager interface shows this:



    The number of application instances that hang builds up over time.
    So, what I want to achieve is to "clean-up" everything after the first connection failure. Or better after a certain number of failed connection attempts. I am not sure how such application instances would affect Wowza if their number grows big over time., so I would like to kill them all.

    Any ideas?

    Thanks in advance,
    Ciprian

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Ciprian,

    The easiest way to limit this to 1 attempt is set the Application.xml /MediaCaster streamTimeout Property to "0".

    <Property>
    	<Name>streamTimeout</Name>
    	<Value>0</Value>
    	<Type>Integer</Type>
    </Property>
    Richard

  3. #3
    Join Date
    Mar 2013
    Posts
    11

    Default

    Richard,

    Thanks for your quick answer. I added that property but unfortunately there is no change.
    The MediaCaster section looks like this now (I hope is ok):

    <MediaCaster>
          <RTP>
            <RTSP>
              <RTPTransportMode>interleave</RTPTransportMode>
            </RTSP>
          </RTP>
       
          <Properties>
          	   <Property>
    			<Name>streamTimeout</Name>
    			<Value>0</Value>
    			<Type>Integer</Type>
    		</Property>
    		</Properties>
        </MediaCaster>
    Ciprian

Similar Threads

  1. Log invalid secureToken attempts
    By russian.hamburguer in forum General Forum
    Replies: 3
    Last Post: 07-09-2013, 04:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •