# Game crashing when failing to connect to internet

**URL:** <https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 12, 2015, 5:16pm UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680 "2015-03-12T17:16:43Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhishek17](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@abhishek17](https://forums.unrealengine.com/u/abhishek17)\
**Post date:** [March 12, 2015, 5:16pm UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680/1 "2015-03-12T17:16:43Z")

</div>

Hi.  
At the start of the game, I connect my game to a website to fetch stuff. But, since I upgraded to 4.7, the game has started to crash when there is no internet connection. The crash happens in editor as well as in the build. This is what the crash report looks like:

 ![33864-nointernetcrash.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/2/a02c611582f2b505eb1373573b3c37bbb8509c5e.png)

I have also tried stuff like FHttpModule::Get().SetHttpTimeout(2.0f); to do a timeOut. Here is what my request code looks like (the following code works fine when internet connection is established):

```
FSagRequest CurrentRequest; //Custom made struct

FString Dest;

FHttpModule::Get().SetHttpTimeout(2.0f);
TSharedRef<IHttpRequest> Request = FHttpModule::Get().CreateRequest();

Request->SetHeader("Content-Type", "text/html");

Request->SetURL(TEXT("http://xyz.com/abc.php"));
Request->SetVerb(TEXT("POST"));

CurrentRequest.AddURLPair("BuildNo", BuildVersion);

Request->SetContentAsString(CurrentRequest.TheData);

Request->OnProcessRequestComplete().BindUObject(this, &AHTTPHandlerActor::OnResponseReceivedQuotes);

if (!Request->ProcessRequest())
{
	
	return false;
}

return true;

```

Any help would be greatly appreciated

---

<div class="post-metadata">

**Author:** ![yusufu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@yusufu](https://forums.unrealengine.com/u/yusufu)\
**Post date:** [March 12, 2015, 5:20pm UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680/2 "2015-03-12T17:20:08Z")

</div>

Ran into this issue too. Killing demoing my game!

---

<div class="post-metadata">

**Author:** ![SiddG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SiddG](https://forums.unrealengine.com/u/SiddG)\
**Post date:** [March 12, 2015, 5:22pm UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680/3 "2015-03-12T17:22:41Z")

</div>

Yeah this broke the game for me when I was showing it at GDC!!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c66b90a1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c66b90a1](https://forums.unrealengine.com/u/anonymous_user_c66b90a1)\
**Post date:** [March 12, 2015, 5:23pm UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680/4 "2015-03-12T17:23:33Z")

</div>

OMG me too! Also during GDC!

---

<div class="post-metadata">

**Author:** ![Azarus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Azarus](https://forums.unrealengine.com/u/Azarus)\
**Post date:** [March 12, 2015, 5:27pm UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680/5 "2015-03-12T17:27:20Z")

</div>

Have you tried to debugging the code? Whats the code for the

```
HTTPHandlerActor::OnResponseReceivedQuote

```

?

---

<div class="post-metadata">

**Author:** ![abhishek17](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@abhishek17](https://forums.unrealengine.com/u/abhishek17)\
**Post date:** [March 12, 2015, 5:31pm UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680/6 "2015-03-12T17:31:05Z")

</div>

void AHTTPHandlerActor::OnResponseReceivedQuotes(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)  
{  
FString MessageBody = “”;

```
if (!Response.IsValid())
{
	MessageBody = "{\"success\":\"Error: Unable to process HTTP Request!\"}";
}
else if (EHttpResponseCodes::IsOk(Response->GetResponseCode()))
{
	MessageBody = Response->GetContentAsString();
	
	
	ResponseError = 0;

}
else
{
	MessageBody = FString::Printf(TEXT("{\"success\":\"HTTP Error: %d\"}"), Response->GetResponseCode());
}

ResponseStr = TCHAR_TO_UTF8(*MessageBody);

```

}

---

<div class="post-metadata">

**Author:** ![abhishek17](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@abhishek17](https://forums.unrealengine.com/u/abhishek17)\
**Post date:** [March 12, 2015, 6:02pm UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680/7 "2015-03-12T18:02:29Z")

</div>

I tried to step through the blueprint where the call to connect to the internet is being made. It did not crash over there, but crashed once the whole onBeginPlay was over. I can`t find the place it is crashing at. The problem is that the check to establish the connection is not being done in a loop. That happens just ONCE!!!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [March 20, 2015, 3:39pm UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680/8 "2015-03-20T15:39:21Z")

</div>

Hey everyone-

Thanks for reporting this crash. We are currently investigating what’s causing the issue (UE-12225) and will update you here with more information when we have a better understanding of the cause.

Cheers

---

<div class="post-metadata">

**Author:** ![abhishek17](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@abhishek17](https://forums.unrealengine.com/u/abhishek17)\
**Post date:** [March 24, 2015, 3:36pm UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680/9 "2015-03-24T15:36:57Z")

</div>

Hi. In the meantime, is there a quick function that can check if the system is connected to internet (like a ping to google), so that I can quickly disconnect my http request on detecting lack of connectivity.  
Thanks.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [April 1, 2015, 5:48pm UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680/10 "2015-04-01T17:48:54Z")

</div>

Hey -

Unfortunately there no easy way to distinguish between the system having a completely dead internet connection and issues such as the server being pinged being down.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41dc327b1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41dc327b1](https://forums.unrealengine.com/u/anonymous_user_41dc327b1)\
**Post date:** [May 11, 2016, 3:09pm UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680/11 "2016-05-11T15:09:14Z")

</div>

Hello, is there a way to check whether the connection is dead or the server pinged is down? 🙂 I don’t really care to distinguish between those two, I’m just ok if I can distinguish between [I can / I cannot] reach the server.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [May 12, 2016, 12:16pm UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680/12 "2016-05-12T12:16:18Z")

</div>

Hey ocramot-

I’m not sure exactly what you’re asking. If you ping the server initially, it should return if it was able to reach it or not (if there is no internet connection then it would not reach the server). If you have further questions, it would be best to open a new post as this was specifically in reference to a crash when trying to connect with no internet connection. By separating the post it helps keep the information related to one issue from being lost within the conversation of another issue.

---

<div class="post-metadata">

**Author:** ![feralmoans](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/feralmoans/32/974428_2.png) [@feralmoans](https://forums.unrealengine.com/u/feralmoans)\
**Post date:** [October 5, 2024, 6:39am UTC](https://forums.unrealengine.com/t/game-crashing-when-failing-to-connect-to-internet/310680/13 "2024-10-05T06:39:35Z")

</div>

I’m running into this issue with UE5.4 [Linux edition].

At first I thought it was just the Blueprint HTTP implementation, but I went through the process of learning how to make an HTTP request with the C++ module, and it’s the same: my editor crashes if the request is performed on a server while it’s down.

Would like to know how to handle gracefully failing a request made to an offline server. Simply crashing is unfortunate.

I had hoped to be able to do something with switching on the EHttpResponseCodes found in the IHttpResponse interface, but the crash occurs on request, prior to getting a response code back.

Any pointers towards a potential solution are appreciated.
