Question

Not sure best way to deal with all this, so I'm coming to you guys for help

What I have is a windows service with a file system watcher waiting for file text file to be created. In the file creation event handler I start a new thread. In I'm parsing these files then pushing them through to another software package via a COM interface. The process of pushing these files through the com interface can take seconds, or minutes simply depending in the amount of info I need to process. So effectively for each file I have 1 thread and 1 active com connection

This I have all working pretty effectively with one problem.
My problem is the Accounting package has a fixed number of concurrent connections available, more often than not the number of files I have hitting this is going to far exceed the COM connection.

I'm just not really sure how I'm going to get around this limitation, so I'm after some different strategies.

I appreciate any help.

Was it helpful?

Solution

Ok, so I've done a whole lot more reading, And I'm just not sure that using a FileSystemWatcher is going to be viable. The size and time of these files coming in is just going to be too random and I'd rather not just have issues with events not firing etc.

I'm going to change my service to poll the directory(s) and get a list of files which I can then process sequentially without making excessive amounts of COM connections

Thanks to anyone that considered this problem for me

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top