Csharp Code Samples

Rohan’s Blog – C# .NET Programming
  • rss
  • Home
  • About
  • Search
  • Contact Me

File System Watcher And Large File Volumes

Rohan Warang | February 23, 2009

File system watcher listens to the file system change notifications and raises events when a directory, or file in a directory, changes. A very useful tool since it notifies exactly at the moment when a file or directory is created, changed or deleted, without having to do polling on that directory. It can watch sub-directories too.

If that wasn’t enough it also provides filters. For instance u just want notifications about text files then you can provide a filter “*.txt”, now event will be raised only for text files.

The Problem

However there is a downside. The file system watcher is not entirely reliable for working with large volumes of files. The reason for this is that there is a fixed buffer allocated to each file system watcher which is used to store the details such as file location for each file that raises an event. However when a large number of files raise an event then this buffer gets full.

Read the rest of this entry »

Comments
8 Comments »
Categories
Optimization
Tags
File System Watcher, Threading, Volume
Comments rss Comments rss
Trackback Trackback

Data Transfer Using Self Hosted WCF Service

Rohan Warang | February 18, 2009

Traditionally services are hosted in IIS. This article describes a method of self hosting and consuming a WCF service without the use of IIS.

The WCF service is declared and configured programmatically i.e without the use of configuration files. Most people would not advice hosting services programmatically. But I believe it is the most compact and easiest way of hosting a WCF service.

I have used two console application one to host the service and second to consume it. The host application demonstrates the use of properly configured self hosted WCF service to transfer large amount of data. However this configuration is not confined to self hosted services it can be applied to any WCF service to improve its performance.

Read the rest of this entry »

Comments
17 Comments »
Categories
Optimization
Tags
Microsoft, Volume, WCF
Comments rss Comments rss
Trackback Trackback

Subscribe

dZone

Categories

  • Optimization
  • Tutorials

Admin

  • Log in
Creative Commons License rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox