# Wowza SDK iOS : Can't reconnect ULL Stream when internet lost -\> Wowza cloud ULL

**URL:** <https://community.wowza.com/t/wowza-sdk-ios-cant-reconnect-ull-stream-when-internet-lost-wowza-cloud-ull/52655>\
**Category:** Wowza GoCoder SDK\
**Created:** [January 14, 2019, 12:24pm UTC](https://community.wowza.com/t/wowza-sdk-ios-cant-reconnect-ull-stream-when-internet-lost-wowza-cloud-ull/52655 "2019-01-14T12:24:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremie\_PERERA](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Jeremie\_PERERA](https://community.wowza.com/u/Jeremie_PERERA)\
**Post date:** [January 14, 2019, 12:24pm UTC](https://community.wowza.com/t/wowza-sdk-ios-cant-reconnect-ull-stream-when-internet-lost-wowza-cloud-ull/52655/1 "2019-01-14T12:24:40Z")

</div>

Hello,

I test my iOS app with Wowza SDK.

I see something wrong… :

When I switch wifi to 4G (cellular phone), the SDK trigger an error with the function : - (void) onWOWZError:(WOWZStatus \*) goCoderStatus

Do you know how i can reconnect the stream ? i try to do this : [self.goCoderstartStreaming:self];

But It doesn’t work…

Thank you for your help ! 🙂

---

<div class="post-metadata">

**Author:** ![Jeremie\_PERERA](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Jeremie\_PERERA](https://community.wowza.com/u/Jeremie_PERERA)\
**Post date:** [January 14, 2019, 1:16pm UTC](https://community.wowza.com/t/wowza-sdk-ios-cant-reconnect-ull-stream-when-internet-lost-wowza-cloud-ull/52655/2 "2019-01-14T13:16:20Z")

</div>

The output of xcode :

**2019-01-14 14:12:40.604738+0100 VisiteMonAppart[9973:4706852] Broadcast status: Broadcast initialization**

**2019-01-14 14:12:40.875907+0100 VisiteMonAppart[9973:4706852] WowzaGoCoderSDK: Default socket buffer size: 131072 with err = 0**

**2019-01-14 14:12:40.876089+0100 VisiteMonAppart[9973:4706852] WowzaGoCoderSDK: Updated socket buffer size: 1024000 with err = 0**

**2019-01-14 14:12:40.925834+0100 VisiteMonAppart[9973:4706852] WowzaGoCoderSDK: Connected**

**2019-01-14 14:12:40.926187+0100 VisiteMonAppart[9973:4706852] WowzaGoCoderSDK: Preparing broadcaster with width = 640, height = 720, frameRate = 24, video bitRate = 348160, audio sample rate = 48000, audio bitrate = 128000**

**2019-01-14 14:12:40.993756+0100 VisiteMonAppart[9973:4706852] Session state changed from HANDSHAKE\_SERVER0\_SENT to CONNECT\_SENT**

**2019-01-14 14:12:40.993858+0100 VisiteMonAppart[9973:4706852] Sending message with the following properties:**

**2019-01-14 14:12:40.993894+0100 VisiteMonAppart[9973:4706852] [00]: “connect”,**

**[01]: 1,**

**[02]: {“app”: “live”,**

**"flashVer": “Wowza GoCoder SDK/1.0”,**

**"swfUrl": “WowzaTransportSDK”,**

**"tcUrl": “wowz://origin.cdn.wowza.com:1935/live”,**

**"fpad": false,**

**"audioCodecs": 3191,**

**"videoCodecs": 252,**

**"pageUrl": “”}**

**2019-01-14 14:12:41.061734+0100 VisiteMonAppart[9973:4706852] message[setbuffersize:unknown]: size:6 cmdId:0**

**2019-01-14 14:12:41.061790+0100 VisiteMonAppart[9973:4706852] Function call SUCCESS result received with the following properties:**

**2019-01-14 14:12:41.061821+0100 VisiteMonAppart[9973:4706852] [00]: “\_result”,**

**[01]: 1,**

**[02]: {“fmsVer”: “FMS/3,5,7,7009”,**

**"capabilities": 31,**

**"mode": 1},**

**[03]: {“level”: “status”,**

**"code": “NetConnection.Connect.Success”,**

**"description": “Connection succeeded.”,**

**"data": {“version”: “3,5,7,7009”},**

**"clientid": 4.18055e+08,**

**"objectEncoding": 0}**

**2019-01-14 14:12:41.061851+0100 VisiteMonAppart[9973:4706852] Invoking the function response handler for function id 1**

**2019-01-14 14:12:41.061865+0100 VisiteMonAppart[9973:4706852] pushPublishMessageReceiveHandleResultConnect: code:NetConnection.Connect.Success**

**2019-01-14 14:12:41.061877+0100 VisiteMonAppart[9973:4706852] Session state changed from CONNECT\_SENT to CONNECTED**

**2019-01-14 14:12:41.061890+0100 VisiteMonAppart[9973:4706852] Sending message with the following properties:**

**2019-01-14 14:12:41.061903+0100 VisiteMonAppart[9973:4706852] [00]: “releaseStream”,**

**[01]: 0,**

**[02]: (NULL),**

**[03]: "0I0p2RWhBVHsS4MkICM9xl5QN0Cu5729"**

**2019-01-14 14:12:41.061965+0100 VisiteMonAppart[9973:4706852] Sending message with the following properties:**

**2019-01-14 14:12:41.061978+0100 VisiteMonAppart[9973:4706852] [00]: “createStream”,**

**[01]: 2,**

**[02]: (NULL)**

**2019-01-14 14:12:41.113505+0100 VisiteMonAppart[9973:4706852] Function call SUCCESS result received with the following properties:**

**2019-01-14 14:12:41.113548+0100 VisiteMonAppart[9973:4706852] [00]: “\_result”,**

**[01]: 2,**

**[02]: (NULL),**

**[03]: 1**

**2019-01-14 14:12:41.113562+0100 VisiteMonAppart[9973:4706852] Invoking the function response handler for function id 2**

**2019-01-14 14:12:41.113574+0100 VisiteMonAppart[9973:4706852] pushPublishMessageReceiveHandleResultCreateStream: isError: 0**

**2019-01-14 14:12:41.113603+0100 VisiteMonAppart[9973:4706852] Sending message with the following properties:**

**2019-01-14 14:12:41.113618+0100 VisiteMonAppart[9973:4706852] [00]: “publish”,**

**[01]: 3,**

**[02]: (NULL),**

**[03]: "0I0p2RWhBVHsS4MkICM9xl5QN0Cu5729"**

**2019-01-14 14:12:41.821696+0100 VisiteMonAppart[9973:4706852] message[setbuffersize:unknown]: size:6 cmdId:0**

---

<div class="post-metadata">

**Author:** ![Jeremie\_PERERA](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Jeremie\_PERERA](https://community.wowza.com/u/Jeremie_PERERA)\
**Post date:** [January 14, 2019, 3:38pm UTC](https://community.wowza.com/t/wowza-sdk-ios-cant-reconnect-ull-stream-when-internet-lost-wowza-cloud-ull/52655/3 "2019-01-14T15:38:27Z")

</div>

It seems that when i wait 10 seconds before restart the stream, it works…

Can you tell me why ?

Is this solution is the best way ? :

My code :

```auto
- (void) onWOWZError:(WOWZStatus *) goCoderStatus {
// If an error is reported by the GoCoder SDK, display an alert
// that contains the error details using the U/I thread
	dispatch_async(dispatch_get_main_queue(), ^{
		UIAlertView *alertDialog =
		[[UIAlertViewalloc] initWithTitle:@"Streaming Error"
			message:goCoderStatus.description
			delegate:nil
			cancelButtonTitle:@"OK"
			otherButtonTitles:nil];
		[alertDialog show];

		if([networkConnectionWhileRecordingisEqualToString:@""])
		{
			_lSearchNetwork.text = @"Connexion dans 10 secondes";
			[self performSelector:@selector(startStreaming) withObject:@"" afterDelay:10.0];
		}
	});
}

```

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [January 14, 2019, 4:17pm UTC](https://community.wowza.com/t/wowza-sdk-ios-cant-reconnect-ull-stream-when-internet-lost-wowza-cloud-ull/52655/4 "2019-01-14T16:17:27Z")

</div>

Let me check into this for you @Jeremie PERERA…

---

<div class="post-metadata">

**Author:** ![Jeremie\_PERERA](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Jeremie\_PERERA](https://community.wowza.com/u/Jeremie_PERERA)\
**Post date:** [October 19, 2019, 7:34pm UTC](https://community.wowza.com/t/wowza-sdk-ios-cant-reconnect-ull-stream-when-internet-lost-wowza-cloud-ull/52655/5 "2019-10-19T19:34:06Z")

</div>

Hello @Rose Power-Wowza Community Manager.

I always have this problem when my iOS lost the internet connection.

I am using AFNetworkReachabilityManager for the dection of the internet lost.

Then when internet is up, I detect id goCoder has no error, and i try to reconnect. sometimes, i get this error :

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #000000; background-color: #ffffff}

**SendDelegateMessage(NSInvocation \*): delegate (webView:identifierForInitialRequest:fromDataSource:) failed to return after waiting 10.000000 seconds. main run loop mode: kCFRunLoopDefaultMode**

I am using the broadcast function with the MP4 writing.

So i can’t today handle the internet lost, this crash my app… do you have any idea ?

---

<div class="post-metadata">

**Author:** ![Jeremie\_PERERA](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Jeremie\_PERERA](https://community.wowza.com/u/Jeremie_PERERA)\
**Post date:** [October 19, 2019, 7:34pm UTC](https://community.wowza.com/t/wowza-sdk-ios-cant-reconnect-ull-stream-when-internet-lost-wowza-cloud-ull/52655/6 "2019-10-19T19:34:18Z")

</div>

Hello [@Rose Power-Wowza Community Manager](http://community.wowza.com/community/questions/50336/wowza-sdk-ios-cant-reconnect-on-switch-wifi-4g-wow.html#).

I always have this problem when my iOS lost the internet connection.

I am using AFNetworkReachabilityManager for the dection of the internet lost.

Then when internet is up, I detect id goCoder has no error, and i try to reconnect. sometimes, i get this error :

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #000000; background-color: #ffffff}

**SendDelegateMessage(NSInvocation \*): delegate (webView:identifierForInitialRequest:fromDataSource:) failed to return after waiting 10.000000 seconds. main run loop mode: kCFRunLoopDefaultMode**

I am using the broadcast function with the MP4 writing.

So i can’t today handle the internet lost, this crash my app… do you have any idea ?

---

<div class="post-metadata">

**Author:** ![Jeremie\_PERERA](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Jeremie\_PERERA](https://community.wowza.com/u/Jeremie_PERERA)\
**Post date:** [October 22, 2019, 10:00am UTC](https://community.wowza.com/t/wowza-sdk-ios-cant-reconnect-ull-stream-when-internet-lost-wowza-cloud-ull/52655/7 "2019-10-22T10:00:17Z")

</div>

Ok I find a way :

Use the wowza status function to trigger a loss of internet connection.

And update the Wowza iOS SDK which resolve the problem that you can reconnect after a deconnection
