Hey there,
I am currently struggling with a FRunnable I created…
I set up a custom FMessageHandler inheriting FRunnable to read messages coming in via tcp. This works quite well, but I want this thing to clear its local ‘Instance’ field when the client disconnects (which I currently determine via ping’ing it from Server->Client).
This is my create call:
Thread = FRunnableThread::Create(this, TEXT(“FMessageListener”), true, true, 0, TPri_BelowNormal);
To get the messages inside my managing class, I bound a local method which gets called when a message arrived.
If the message is “DISCONNECT” I set the IsActive flag to false which in turn should the Run-method inside the Thread cause to quit. After that I thought the Thread somehow knows its “done” now and will auto-delete itself. But it wont…
Any information on this? When is this auto-deletion happening? Do I get this wrong?
If thats not the way to use this, then how can I delete my Instance, so that another connecting client can get its “own” instance for communication?
Thanks in advance…
Tim
EDIT:
I just saw, that:
"‘FRunnableThread::Create’: Function deprecated. Use FRunnableThread::Create without bAutoDeleteSelf and bAutoDeleteRunnable params and delete thread and runnable manually. "