Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
I want to make a program which should be in two part. a Server and a bunch of Clients. Server has some functions and clients too.

for example Server asks for some information from client , and client should answer it. both of them should send and receive data and the size of this data could be large.(about 5MB). and i want to be able to send DataTable from client to server.

one another thing is I want to use this program in a Lan Network with Domain.

which structure i should use?with considering the ease and speed of implementation.

thanks

New Problem :
I looked at the link and i learned a little about Duplex communication. But in the way i got this,we have a service (which i should call it server) offers some operations and we have clients which uses these operations. and this operations through a callback uses another operation of the client. my problem is I have a Main Program which maybe i run it from on any node in my lan. this Main program displays a list of Computers in my domain.each one has a local Ip Address.I want to send some requests to the selected client and client must return some data to server. please guid me how can i do such a thing thanks
Posted
Updated 15-May-12 20:53pm
v2

You can implement it in 3 ways:

1. Socket programming - Here you will have to send all the data in text form and the assembling/dissembling of data from text to data-set will be the applications responsibility. choice of protocols is available.

2. Web-service - You can have a web-service if the only HTTP will be used for communication. [Here only one way communication is possible]

3. WCF - essentially the same functionality as web service but gives more protocols to access like http, tcp, ipc etc. [using this you can have data duplex communication too]

so I would suggest you do an analysis based on requirements, time frame and knowledge and then process.

P.S. web service will perhaps be the easiest. WCF seems to be best in your case.

[EDIT]Corrected the problem (thankfully) pointed out by Mr. Pete O'Hanlon [/EDIT]
 
Share this answer
 
v2
Comments
Pete O'Hanlon 15-May-12 3:58am    
The Web Service choice does not fit his stated aims. As the OP stated that he wanted duplex functionality (i.e. the server "talking" to the client as well), a Web Service is a poor choice.
Rahul Rajat Singh 15-May-12 4:03am    
My Bad. I have corrected my answer.
Pete O'Hanlon 15-May-12 4:03am    
My 5 now you've corrected the post.
mahdi87_gh 15-May-12 4:23am    
thanks a lot
Given the fact that you want to implement duplex communication, and given the fact that WCF is a framework that allows you to use multiple different protocols, I would recommend WCF out of the choices you present. In order to get an idea on how to implement duplex communications in WCF, you should have a read of this[^] article.
 
Share this answer
 
Comments
Rahul Rajat Singh 15-May-12 4:03am    
+5
mahdi87_gh 15-May-12 4:24am    
thanks
I will look at your link and I'll come back later
mahdi87_gh 16-May-12 2:14am    
I looked at the link and i learned a little about Duplex communication.
But in the way i got this,we have a service (which i should call it server) offers some operations and we have clients which uses these operations. and this operations through a callback uses another operation of the client.

my problem is I have a Main Program which maybe i run it from on any node in my lan. this Main program displays a list of Computers in my domain.each one has a local Ip Address.I want to send some requests to the selected client and client must return some data to server.
please guid me how can i do such a thing
thanks
Socket Programming is the best approach according to me because i have done this type of work(not same but this type of) and i used socket programming
 
Share this answer
 
Comments
mahdi87_gh 16-May-12 8:13am    
I found WCF quiet very easier than socket programming. because i need to transfer dataTable from client to server and the size of this information is high. with considering this situation could you show me a good article with sample code?
hunain.esh 18-May-12 2:10am    
This link is very helpful for socket programming
http://www.codeproject.com/Articles/2477/Multi-threaded-Client-Server-Socket-Class
I wrote a WCF Service and Host it to IIS
Now in order to send intruction to clients, each client must check a value from this service every 5 secs.
is there a better way to implemenet my scenario?
 
Share this 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