Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey all,

I had found an article on codeproject that is similar to what is need,
Monitoring file activity on removable devices
Now, how would I make this kind of an application work a number of network computers? All network computers are running on windows and server is running on windows sever 2008.

Please help.
Posted
Updated 17-Jan-11 18:23pm
v2

1 solution

Obvious solution is this:

1) Develop file watcher application in the form of Windows Service.
2) In the service, develop publisher-subscriber, the service should act a a subscriber service (serve up subscribe/unsubscribe operation via network).
3) A subscriber service should support a collection of remote sockets representing a subscriber, a new TCP session should be established with each subscribers.
4) A publisher part of the Windows Service should process events from the File Watcher (should be a separate thread) and distribute the file system modification events to all subscribers via respective TCP session; only one thread should support the protocol of distribution of the event to all subscribers.
5) The exchange protocol should require every subscriber to send confirmation of each event received. The subscribers should be removed from the subscriber's collection on network exception; this way smooth operation will be maintained whatever the reason for the client disconnection is -- client system shutdown, broken, client application closed, etc.

Basically, that's it. It all needs fixed number of threads (fixed, no such thing as a thread per client as many try to design -- important!), serious design of thread synchronization, networking based on TcpListener and TcpClient. Publisher subscriber needs just two threads: one listening for new connection, another one sends/receives file system events/confirmations to/from clients.

Whole architecture -- quite a work. Maybe, 2-3 weeks. Need help? :)

[UPDATE]

Let's ask why such project can be useful practically? After some thinking, I would say: not much. I faced with business production environments based on sending files, detecting the arrival and generating some messages based on them. Everything was a result of very sloppy legacy software based on file exchange. Detection of changes in file system was required for system integration. It can never be a reasonable or even acceptable solution. Technically, it's quite possible, using the recipe I described. Practically, that would simply indicate extremely bad architecture of the whole system. Computer systems are designed to be isolated, exposing the file system events to another computer would be dirty unsafe practice.

A File System Watcher on a single computer can be very useful. One application: to conduct black box investigation of what some software is doing behind the scene, especially software like installer. I hardly can imagine useful application for a network.
 
Share this answer
 
v2
Comments
Sandeep Mewara 17-Jan-11 0:22am    
Comment from OP:
hey SAKryukov

thnks a lot for your help,but ironically i didnt understand anything.Its just that i am a college student and not famliar with all that you said.If possible could you help me with undrestanding this in a simpler way.IS there a simpler way to do this???????
srry for my ignorance,but pls do help if you can.
anirban_sinha 17-Jan-11 0:34am    
hey SAKryukov thnks a lot for your help,but ironically i didnt understand anything.Its just that i am a college student and not famliar with all that you said.If possible could you help me with undrestanding this in a simpler way.IS there a simpler way to do this??????? srry for my ignorance,but pls do help if you can
Sergey Alexandrovich Kryukov 17-Jan-11 0:49am    
Anirban,

What do you mean "a simpler way"? This is a simple, clean, manageable plan with low risk. Simpler way may mean only one thing: similar project is already created (or a more generic framework capable of plugging in file watcher capability at low development cost). If such project or framework exists, it is hardly more simple compared to what I describe.

You can try to find some relevant open source project on the Web, but what is your purpose? Do you need just a solution, or you need a project for your college studies?

Unfortunately, if you did not understand my description, you're not ready for considering tasks of this level. If your major is software development, you should reach this level sooner or later. For now, you need to gain confidence in more elementary techniques... Good things are never easy.
anirban_sinha 17-Jan-11 3:31am    
SAKryukov,Well by simpler is i meant things i could understand,but i dont seem to alas!!!!well.my major isnt exactly software devpl.Its more to do with networks but i wannna get in to app devp...anyways thnks fo all the help....just wanted to let you knw my project is solution(freewares/scripts) to monitor USB devices....such as whitelisting and blacklisting devices,monitoring copy event on these devices...finally i found the an app which was close but i could not deploy it over a network of compuetrs,my limited knowledge being being the devil here.Anyways thnks a lot for your help
any more suggestions or comments that you can provide would be great.
Sergey Alexandrovich Kryukov 18-Jan-11 0:11am    
Not that I can help you much to understand thing. We cannot spend months with you. I have a critical node of the motivation of such project. Let me update my answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900