I don’t quite follow: are you saying that if one of the TCP sockets is receiving data—triggering the dataAvailable event—it won’t process any other code until that execution finishes?
So, would 40 TCP sockets receiving data continuously block all other application activity, including timers?
Unfortunately, the socket and timer events are all running on the main thread which means only one method can run at a time.
You need to make the DataAvailable events do as little as possible - ie: add the incoming data to a buffer and process it via a thread.
The enhancement which I referred to in my previous post is for sockets to use preemptive threads which would free the main thread to allow the timer to operate correctly.
you could also run a thread and compare a datetime and then do what you need to do.
and with Preemptive Threads it could run at different cpu core too.
i think is that the best approach is create 2 apps, one for listeners and other to elaborate buffer (Buffer = same local sqllite db for listener app end for queque elaborator app ) , the second app (queque elaborator) in not impatted from the tcpsocket of the firs app and can use premptive threads and his timer