How do I stop the program without exiting the unreal engine editor? (Only in c++)

Hi everyone. I’m using a custom tcp client code within the c++ part of my program.

If my program detects any anomalies while communicating with the tcp server, I want the program to shut down.

Currently, I’m using


FGenericPlatformMisc::RequestExit(false);

, and it works.

But the problem here is that the unreal editor is completely shut down, so every time it happens I have to reopen the editor again and again.

I only want the running level stopped if this happens, so I can press the play button again without reopening the editor. Is there a function I can take a look at in this situation?

(My version is 4.24.1, jic if it matters)

I haven’t tested this, but the following function should work:



UKismetSystemLibrary::QuitGame(...);


You can also use RequestEngineExit(TCHAR * Message): https://docs.unrealengine.com/en-US/…t/1/index.html
IIRC, QuitGame(…) just calls RequestEngineExit(…)

Thanks everyone! It worked perfectly : )