G
Guest
I have a fairly simple VB.Net program I'm developing that listens to data
coming over the internet and processes it. The data comes in as events - the
app is idle until another chunk of data comes through. When it does, the app
looks to see what kind of data it is, and does something with it, such as
parse the data, write it to a file, ignore it, etc.
The code almost completes when it throws a stack overflow exception. The
code makes no recursive calls. I suspect the data is coming through faster
than the app can process it, and events keep piling up until the stack
overflows. Is that possible? The exception happens at random points - never
the same Sub or Function twice in a row. But it does happen, every time.
The reason I think so is because when I process the data in real time, it
throws an exception. When I just record everything to a file and process it
from a file later instead of live, with the same code, no problem at all. The
problem is, I need the results in more or less real time, not later.
If it could be that the events are piling up too fast, it's not critical
that I process every single piece of data that comes through - there are
natural breakpoints in my code where, if it's possible, I would be willing to
clear all pending events. Can that be done? Is it a reasonable approach?
Thanks!
Eric
coming over the internet and processes it. The data comes in as events - the
app is idle until another chunk of data comes through. When it does, the app
looks to see what kind of data it is, and does something with it, such as
parse the data, write it to a file, ignore it, etc.
The code almost completes when it throws a stack overflow exception. The
code makes no recursive calls. I suspect the data is coming through faster
than the app can process it, and events keep piling up until the stack
overflows. Is that possible? The exception happens at random points - never
the same Sub or Function twice in a row. But it does happen, every time.
The reason I think so is because when I process the data in real time, it
throws an exception. When I just record everything to a file and process it
from a file later instead of live, with the same code, no problem at all. The
problem is, I need the results in more or less real time, not later.
If it could be that the events are piling up too fast, it's not critical
that I process every single piece of data that comes through - there are
natural breakpoints in my code where, if it's possible, I would be willing to
clear all pending events. Can that be done? Is it a reasonable approach?
Thanks!
Eric