Sonjli 6 Posted June 30, 2021 Hi, I hardly use tasks comm. A very simple question: is this code right? if lTask.Comm.Writer.IsFull then begin lLocalLogger.Debug(Format('Task Queue is FULL %s...', [lTask.Name]), lSenderLogTagMain); Sleep(1000); ... end else lTask.Comm.Send(WM_RECEIVE_DO, TOmniValue.CastFrom < IBroadcastMessage < TDataPacketBody >>(ABroadcastMessage)); ... Share this post Link to post
Sonjli 6 Posted July 6, 2021 I try to better explain my problem. I understand the last question was a bit (lot...) stupid 😉 I need to know if the receiver task is alive. In some cases the receiver task has gone so I continue to send messages to it and I receive this error: "TOmniCommunicationEndpoint.Send: Queue is full" How can I avoid this problem? I would like to do something like this: if not MyTask.IsDead then MyTask.Comm.Send(...) // or if WatchDog(MyTask) <> Dead then MyTask.Comm.Send(...) // where WatchDog can check the healty of the Task and the MyTask.Comm.Writer.IsFull Thanks in advance, Eddy Share this post Link to post