Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am working on to sync files between servers. I have created windows service which implements FileSystemWatcher .net object which allows one to monitor local folder path and get changes as files or folders get created, deleted, renamed or changed events and take action based on them.

In my case, I am replicating the changes to other folder where I want to sync the source folder content to.

I have enabled two way syncing by creating two windows services and pointing to local folder path and syncing to other: e.g service1 watches c:watch1 and sync to c:watch2.
service2 watches c:watch2 and sync to c:watch1. This way changes on either side is replicated to other side.

Now, I want to install the service on two different machine and replicate the changes across machine.

I don't know a way for two windows services to talk to each other. Possible solutions would be WCF duplex service or use a Microsoft sync framework.

I tried WCF duplex service but encountered following problem. It needs to run as an admin under windows xp machine(i am going to run on both xp or windows server machines). I tried to google the solution to allow non-admin user to have duplex service and found out that I need to do following:
http://msdn.microsoft.com/en-us/library/ms733768.aspx[^]

this is the syntax for configuring namespace reservation: http://msdn.microsoft.com/en-us/library/ms733768.aspx[^]

can someone help me with the syntax?

Also, I am planning to prototype the MS Sync framework but don't know which port does it use to communicate between server? What networking technologies does it use to establish the communication. The company that I work for has strict limitation on how servers talk to each other and need to develop something that will work without admin rights.

I need to deliver this asap and need urgent suggestions:

Thanks
Posted
Updated 13-Jul-11 6:41am
v3

MS Sync framework has samples for this usecase, check the samples first, as it is ready to go as is.
 
Share this answer
 
Comments
Simon Bang Terkildsen 2-Sep-11 6:45am    
+5
Oshtri Deka 2-Sep-11 6:54am    
5
I wrote an article that kinda does that.

Synchronicity - A Folder Synchronizing Application[^]
 
Share this answer
 
Comments
Oshtri Deka 2-Sep-11 6:54am    
5

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