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:
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):
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!!!
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.
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.
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.
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.
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.
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.