Right now, I have a Runnable for connecting to and receiving from a FSocket. I’m pretty new to UE, so please bare with me. If the TCP connection can not connect to the server, I need to basically create a widget and add it the viewport. Creating the widget from code is no problem but I know you’re not supposed to make objects from other threads, so, what I’m asking is the best way to go about getting “events” or something like that from the runnable.
I’m pretty bad at explaining things so please let me know if something is unclear.
When you create the FRunnable thread, also pass a TFunction pointer to it, which will be called if the TCP connection fails. Then fire that function, through an AsyncTask on the GameThread. Move the widget creation logic in that function. This will make sure, that the widgets are created on the Main thread, while keeping your logic intact on your worker thread.