Click here to Skip to main content
14,331,901 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi All Code Project Users,

I am developing a Client Server communication application.
My scenario is like ,
I have 1 server and 10 clients.
I am generating 1 XML file on server.
I want to transfer that file to all my clients with the service installed on it.
Right now I am able to generate an XML file from a desktop application.
I am storing this file in particular folder.
Now I want to transfer this file to each client via a service installed on each Client.
So anyone can help me how to transfer a file from Server to Client automatically.

I mean to say there is no application interface on Client.So by a click on server i want to transfer that file to Client.

Please help me to find out this

Thanks in Advance,
Rate this:
Please Sign up or sign in to vote.

Solution 1

The FTP service may already do what you want:
depending on your OS, this may be located in different places, but you should find a function somehwhere in control panel that lets you add features to your windows installation. Locate the 'FTP server' one and enable it. You will also have to define public directories where your service may deposit the files. Read up on the FTP service, and be sure that you understand the security implications of what you're doing.
Rate this:
Please Sign up or sign in to vote.

Solution 3

What you should do is have your server listen for client connections (TcpListener), and have each client request the new file. If it exists, respond by sending the contents of the file to the client. If it doesn't exist, send an appropriate response.

The important thing to notice here is that the server is passive, and that the clients initiate the exchange.
Rate this:
Please Sign up or sign in to vote.

Solution 2

Communicating with Windows Services can be tricky and painful at some point, I'd suggest you to read about remoting in .Net, that will give you a better idea, and also read about Windows Services, as they have a very peculiar way on how they work and interact with the OS.

Have you considered using a Web Service?

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100