# Get the connection error code from live stream

**URL:** https://community.wowza.com/t/get-the-connection-error-code-from-live-stream/34972
**Category:** Wowza Developer Dojo
**Tags:** wowza-streaming-server-java-api
**Created:** [June 14, 2010, 8:14am UTC](https://community.wowza.com/t/get-the-connection-error-code-from-live-stream/34972 "2010-06-14T08:14:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Gladys\_Tang](https://avatars.discourse-cdn.com/v4/letter/g/b782af/32.png) [@Gladys\_Tang](https://community.wowza.com/u/Gladys_Tang)
#### Post date: [June 14, 2010, 8:14am UTC](https://community.wowza.com/t/get-the-connection-error-code-from-live-stream/34972/1 "2010-06-14T08:14:39Z")

</div>

Hi,

I’m new to Wowza and I’ve set up a live streaming (Wirecast). During the live streaming, I would like to know if the user stop the stream normally or there’s any connection error between the streaming machine and the wowza server so that I can update a status that stored in DB. Is there any server API that I can get the connection fail error code?

I know that if it’s the connection error, wowza server will try to ping the streaming machine and if timeout, it’ll disconnect the streaming.

Thanks!

---

<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: [June 14, 2010, 8:38pm UTC](https://community.wowza.com/t/get-the-connection-error-code-from-live-stream/34972/2 "2010-06-14T20:38:24Z")

</div>

With a stream that is being "pushed from Wirecast, Wowza will just wait indefinitely for the stream to continue.

The StreamTimeout/reconnect behavior you are referring to is with streams that are “pulled”, i.e., MediaCaster streams, e.g., an rtsp stream from an IP camera or a shoutcast stream.

You can use this StreamWatchdog example to see if the stream is active, by checking packets:

[http://community.wowza.com/t/-/243](http://community.wowza.com/t/-/243)

Richard

---

<div class="post-metadata">

### Author: ![Gladys\_Tang](https://avatars.discourse-cdn.com/v4/letter/g/b782af/32.png) [@Gladys\_Tang](https://community.wowza.com/u/Gladys_Tang)
#### Post date: [June 14, 2010, 1:35pm UTC](https://community.wowza.com/t/get-the-connection-error-code-from-live-stream/34972/3 "2010-06-14T13:35:56Z")

</div>

But I can see the ping time out message from wowza server console when I manually disconnect the network of the machine where wirecast is live broadcasting.

Here’s the wowza console message:

INFO server comment - client connectionClosed [1148934568] pingtimeout

WARN server comment - LiveReceiver.resetSortBuffer[myStream]: diff:33629:2000 sortRTStart:1276550436432 sortTCStart:26850

INFO stream unpublish myStream -

INFO server comment - onStreamDestroy: 1

INFO stream destroy myStream -

INFO session disconnect 1148934568 -

INFO server comment - onDisconnect: 1148934568

INFO application app-stop _definst_ live/_definst_

INFO server comment - onAppStop: live/_definst_

I need to know if there’s any API like “isPingTimeout()”. If the stream is stopped by the user normally, the first line in the message won’t appear.

---

<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: [June 15, 2010, 6:44pm UTC](https://community.wowza.com/t/get-the-connection-error-code-from-live-stream/34972/4 "2010-06-15T18:44:11Z")

</div>

You can use the IMediaStreamActionNotify2 interface to see normal events, onPublish and onUnPublish are event handlers for publishing client.

[http://community.wowza.com/t/-/242](http://community.wowza.com/t/-/242)

When I disable my internet connection from a computer on my lan that is publishing to a Wowza app on another computer, the onUnPublish event does not fire.

Richard
