FRunnable Messaging Thread With Events Blocking The Main Thread c

Hello Comunity,

I have been developing an Unreal Engine Plugin using the zmq communication protocol.

For reference I have been using Ramas FRunnable Tutorial. #include “FPupilMsgWorker.h”

  1. FPupilMsgWorker* FPupilMsgWorker::Instance = nullptr;
  2. FPupilMsgWorker::FPupilMsgWorker()
  3. {
  4. Thread = FRunnableThread::Create(this, TEXT(“PupilMsgWorker”), TPri_BelowNormal);
  5. }

I am sending data using an event

  1. if (Confidence > 0.4f){
  2. NewPupilDataEvent.Broadcast(&ReceivedGazeStructure);
  3. }

Every time I close the server from which I receive the data the thread blocks at this function call

  1. zmq::message_t topic;
  2. SubSocket->recv(&topic);

I understand why the function call is blocked but I do not understand why it blocks the whole game. I also checked with the debugger that we are in another Thread.

Why is this blocking my main thread and what action can I take to avert this ?