# Publish timeout settings

**URL:** https://community.wowza.com/t/publish-timeout-settings/34214
**Category:** Wowza Streaming Engine
**Created:** [December 27, 2011, 12:52pm UTC](https://community.wowza.com/t/publish-timeout-settings/34214 "2011-12-27T12:52:01Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![M\_de\_G](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@M\_de\_G](https://community.wowza.com/u/M_de_G)
#### Post date: [December 27, 2011, 12:52pm UTC](https://community.wowza.com/t/publish-timeout-settings/34214/1 "2011-12-27T12:52:01Z")

</div>

Hi,

Is it possible to set a timeout value in Wowza, when a publisher doesn’t send any more data, to unpublish a stream?

A little explanation / clarification;

When an encoder is suddenly interrupted (for example; power outage), there is no Disconnect/ Unpublish event in Wowza. The stream would be unpublished and published again if the encoder starts a new session. In our case, this could be hours later (or when Wowza restarts). We would like to set a timeout, so that Wowza “forces” an Disconnect/Unpublish event after a certain period when no data is received. How can we set up a timeout? Is this a configuration setting in Wowza?

Thanks in advance.

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [December 29, 2011, 3:13pm UTC](https://community.wowza.com/t/publish-timeout-settings/34214/2 "2011-12-29T15:13:47Z")

</div>

I’m not sure how to force the event, but you can monitor a stream like this:

[https://www.wowza.com/docs/how-to-use-imediastreamactionnotify2-to-monitor-live-streams-modulestreamwatchdog](https://www.wowza.com/docs/how-to-use-imediastreamactionnotify2-to-monitor-live-streams-modulestreamwatchdog)

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [January 9, 2012, 5:00pm UTC](https://community.wowza.com/t/publish-timeout-settings/34214/3 "2012-01-09T17:00:16Z")

</div>

If it is RTMP push encoder, you can try to shutdown the client and you can send notification. In some cases the encoder might just try to reconnect.

```auto
client.setShutdownClient(true);
sendClientOnStatusError(client, "NetConnection.Connection.Rejected", "Rejected");

```

Other standard notifications you can use:

[http://help.adobe.com/en\_US/FlashPlatform/reference/actionscript/3/flash/events/NetStatusEvent.html](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/NetStatusEvent.html)

If it is MediaCaster source it’s easy to handle with MediaCaster API

[https://www.wowza.com/docs/how-to-use-the-wowza-streaming-engine-java-api-to-start-and-stop-mediacaster-streams](https://www.wowza.com/docs/how-to-use-the-wowza-streaming-engine-java-api-to-start-and-stop-mediacaster-streams)

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [January 11, 2012, 3:01pm UTC](https://community.wowza.com/t/publish-timeout-settings/34214/4 "2012-01-11T15:01:35Z")

</div>

You can monitor a stream like this:

[https://www.wowza.com/docs/how-to-use-imediastreamactionnotify2-to-monitor-live-streams-modulestreamwatchdog](https://www.wowza.com/docs/how-to-use-imediastreamactionnotify2-to-monitor-live-streams-modulestreamwatchdog)

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [January 11, 2012, 5:03pm UTC](https://community.wowza.com/t/publish-timeout-settings/34214/5 "2012-01-11T17:03:32Z")

</div>

Instead of sending info to a Flash client, do whatever you need in that circumstance

Richard

---

<div class="post-metadata">

### Author: ![M\_de\_G](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@M\_de\_G](https://community.wowza.com/u/M_de_G)
#### Post date: [January 9, 2012, 5:34pm UTC](https://community.wowza.com/t/publish-timeout-settings/34214/6 "2012-01-09T17:34:46Z")

</div>

Richard,

This seems to be a solution, to tell the client that the stream has stopped. I would like to “tell” wowza to force a unpublish/disconnect. A restart of wowza does the trick, but that is not what i`m looking for. Is there a server side solution for this?

---

<div class="post-metadata">

### Author: ![M\_de\_G](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@M\_de\_G](https://community.wowza.com/u/M_de_G)
#### Post date: [January 11, 2012, 10:06am UTC](https://community.wowza.com/t/publish-timeout-settings/34214/7 "2012-01-11T10:06:08Z")

</div>

Richard,

I`ll explain the situation a little better; we are using the unpublish event in wowza for a custom made module.

The unpublish event is not being triggered when the encoder (push encoder) is not being shutdown properly. The stream is being unpublished when wowza is restarted, if wowza will not be restarted, the stream will be “open” until that moment (more technical; the TCP session stays open and wowza does not unpublish the stream until the tcp session is closed). So i`m looking for a trigger, lets say when an encoder is not sending any more data for X time, the stream will be unpublished by wowza.

So i`m looking for a solution on the server side, the client does not have anything to do with it 🙂

---

<div class="post-metadata">

### Author: ![M\_de\_G](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@M\_de\_G](https://community.wowza.com/u/M_de_G)
#### Post date: [January 11, 2012, 4:52pm UTC](https://community.wowza.com/t/publish-timeout-settings/34214/8 "2012-01-11T16:52:15Z")

</div>

Richard,

I`ve seen the thread about monitoring the stream, but that is sending the status of the stream to a flash client. That is not what I am looking for.

Wowza it self has to unpublish the stream when the stream has stopped. So I dont want to monitor the stream at the client side.
