NetTalk Central

Author Topic: Incoming data backing-up in NetTalk  (Read 4586 times)

Simon Kemp

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Incoming data backing-up in NetTalk
« on: October 26, 2017, 01:14:10 AM »
Hi,

Using NetSimple client to receive a stream of FIX (Financial Information Exchange) messages. Traffic can be high but the application has always worked well.

We are now seeing regular incidents where traffic is backing-up (presumably inside clanet.dll). Memory usage climbs along with NetTalk's "qSimpleInData_Bytes" statistic.

My understanding is this should mean "my" thread isn't taking packets from NetTalk, yet "old" data continues to trickle through - it's not like I'm taking nothing.

Right now, it's not making sense. I'm assuming the fault lies with me - any bright ideas on what I should be looking for or ways to diagnose this? Of course I'm unable to replicate it and it's happening on critical production machines - the usual story!

Thanks,
Simon
   

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Incoming data backing-up in NetTalk
« Reply #1 on: October 26, 2017, 08:46:11 AM »
Hi Simon,

the most common cause of this sort of thing is "lost events".
When a packet arrives in the NetTalk DLL an event is sent to the appropriate thread as a sort of "data is waiting" alert.
(the event number is stored in  net._connection.NotifyEvent - it's different for every object).

[aside: it's safe to generate extra events - which is your first thing to try, perhaps on a timer or something]

The event goes to the topmost window on the _thread_. So, if "another window" is open on the thread, above the one that is listening, then events get "lost" (more accurately they go to the other window which just goes meh and throws them away.)

"OtherWindow" might be a MESSAGE, or SendEmail, or Webclient, or any other window that has an ACCEPT loop.

First prize is obviously "don't let another window be on top".
Second prize is to generate extra NotifyEvents to fetch any backlog of packets that may be waiting...

cheers
Bruce

 


Simon Kemp

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Re: Incoming data backing-up in NetTalk
« Reply #2 on: October 26, 2017, 10:56:58 AM »
Thanks Bruce,

That's making sense. Think I can definitely rule out your prize1 (another window on top) here. Need to explore your prize2 (inject NotifyEvents) but not sure that will help - almost convinced the problem is of my own making - I was pushed to "ask CapeSoft" and do appreciate your prompt response.

Simon